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