Results 1 to 3 of 3

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

  1. #1
    zhaohx02 is offline Staff Sergeant
    Join Date
    Apr 2010
    Posts
    42

    Default 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?

  2. #2
    navaldesign's Avatar
    navaldesign is offline General & Forum Moderator
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,115

    Default 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!


  3. #3
    zhaohx02 is offline Staff Sergeant
    Join Date
    Apr 2010
    Posts
    42

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

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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49