Where should I put a update script in a form(#552596)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • zhaohx02
    Staff Sergeant

    • Apr 2010
    • 42

    Where should I put a update script in a form(#552596)

    I add a "user profile" form on a page, when user click "submit" button, a new record will be added in the table in the database, but I don't want to add the new record, I want to modify the current record when user click the "submit" button, so I compose a update script:

    <?php
    $membername=$_SESSION['username'];
    $username="myusername";
    $password="******";
    $database="profiledatabase";
    mysql_connect(localhost,$username,$password);
    @mysql_select_db($database) or die( "Unable to select database");
    mysql_query("update profiletablename WHERE f0_username = '$membername'");
    mysql_close();
    ?>

    Where should I put the update script in the form?
    Can I put the script in the "Events" of the submit button properites?
    or put the script on the success page?
  • navaldesign
    General & Forum Moderator

    • Oct 2005
    • 12080

    #2
    Re: Where should I put a update script in a form(#552596)

    The script will NOT go in the form, but in the processor you are using.

    Actually you should create one, if you haven't already. Then you can either use it as standalone or embed it in your BV page (with a few additional lines).
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

    Comment

    • zhaohx02
      Staff Sergeant

      • Apr 2010
      • 42

      #3
      Re: Where should I put a update script in a form(#552596)

      Thank you.
      I created one these days, it works.
      How excited!

      Comment

      Working...
      X