[PHP]
<?
session_start();
require("db.php");
mysql_connect(MACHINE, USER, '');
mysql_select_db(DBNAME);
$username = $_SESSION['username'];
$pwd =$_SESSION['pwd'];
if(isset($username)){
$customerid = $_POST['customerid'];
$customername = $_POST['customername'];
$customercontact = $_POST['customercontact'];
$orderid = $_POST['orderid'];
$sql = "SELECT * FROM customer";
$result = mysql_query($sql) or die("Unable to get order info");
$row = mysql_fetch_assoc($result);
extract($row);
}
?>
<html>
<head>
<title>Update Customer Details</title>
</head>
<body>
<form action="do_updatecustomer.php?action=do_updatecust omer&orderid=<?php echo $orderid; ?>" enctype="multipart/form-data" method='post'><br>
<link rel="stylesheet" type="text/css" href="fyp.css" />
<b></b><br><br>
<table border="0">
<tr><td>Customer Name:</td>
<td><input type="text" name ="customername" value ="<?php echo $customername; ?>"></td></tr>
<tr><td>Customer Contact:</td>
<td><input type="text" name ="customercontact" value ="<?php echo $customercontact; ?>"></td></tr>
<tr><td>Order ID:</td>
<td><input type="text" name ="orderid" value ="<?php echo $orderid; ?>"></td></tr>
<tr><td><input type="reset" value="Reset"></td>
<td><input type = "Submit" name="submit" value="Update"></td></tr>
</table>
</form>
</body>
</html>
<?
session_start();
require("db.php");
mysql_connect(MACHINE, USER, '');
mysql_select_db(DBNAME);
if (isset($_POST['submit']))
{
$customerid = $_GET['customerid'];
$customername = $_POST['customername'];
$customercontact = $_POST['customercontact'];
$orderid = $_POST['orderid'];
$sql = "UPDATE 'customer' SET 'customername' = '$customername',
'customercontact' = '$customercontact','orderid' = '$orderid' WHERE 'customerid' = '$customerid'";
$result = mysql_query($sql) or die ("Unable to Update Customer Information");
}
//echo "Customer Details has been updated from database.";
//<br><br>
//"<a href=cus_details.php>View Customer Details</a><br>";
//"<a href=index.php>Go to Mainpage</a><br>";
?>
[/PHP]
I can't seem to update...Could someone be so kind to help me check my codes =)