update data in my php form
Posted: Wed Aug 18, 2010 1:28 pm
Hi all,
I want to modify details in my form. Therefore i use following code. But it does not work properly.Can anyone check and see where am i go wrong?
Thanks,
Heshan
I want to modify details in my form. Therefore i use following code. But it does not work properly.Can anyone check and see where am i go wrong?
Code: Select all
<?php
$customer_id = $_POST['customer_id'];
$nic =$_POST['nic'];
$full_name=$_POST['full_name'];
$name_with_initials=$_POST['name_with_initials'];
$address=$_POST['address'];
$contact_number=$_POST['contact_number'];
$gender=$_POST['gender'];
$result = mysql_query("UPDATE customer SET `nic` = '$nic', `full_name` = '$full_name', `name_with_initials` = $name_with_initials', address = '$address', contact_number = '$contact_number', gender = '$gender' WHERE `customer_id` = '$customer_id' ");
if($result)
echo "Your information has been successfully added to the database.";
else
echo "Failed";
?>
Heshan