I have tried the following script to update multiple field but data not save into database
PHP Code:
<?php
$tbl_name = "member";
if (isset($_POST['submit']))
{
$update = mysql_query("
UPDATE
$tbl_name
SET
name = '" . mysql_real_escape_string($_POST['edited1']) . "',
telephone = '" . mysql_real_escape_string($_POST['edited1']) . "',
address = '" . mysql_real_escape_string($_POST['edited2']) . "'
WHERE
name = '" . mysql_real_escape_string($_REQUEST['name']) . "',
telephone = '" . mysql_real_escape_string($_REQUEST['telephone']) . "',
address = '" . mysql_real_escape_string($_REQUEST['address']) . "'
or die(mysql_error())
");
if ($update)
{
?> <script type="text/javascript">
alert("Your profile already updated.");
history.back();
</script>
<?php
//THIS CODE IS UNCOMMENTED
//So that people without JS can still see the message.
die("Your profile already updated");
//END
}
}
?>
I am using action = "<? echo $HTTP_SERVER_VARS['PHP_SELF'] .
"?frame=profile"; ?>", which reflect the page(profile.php) itself.
Bookmarks