[PHP]
<?
session_start() ;
require("db.php ");
mysql_connect(M ACHINE, USER, '');
mysql_select_db (DBNAME);
$username = $_SESSION['username'];
$pwd =$_SESSION['pwd'];
if(isset($usern ame)){
$customerid = $_POST['customerid'];
$customername = $_POST['customername'];
$customercontac t = $_POST['customercontac t'];
$orderid = $_POST['orderid'];
$sql = "SELECT * FROM customer";
$result = mysql_query($sq l) or die("Unable to get order info");
$row = mysql_fetch_ass oc($result);
extract($row);
}
?>
<html>
<head>
<title>Update Customer Details</title>
</head>
<body>
<form action="do_upda tecustomer.php? action=do_updat ecustomer&order id=<?php echo $orderid; ?>" enctype="multip art/form-data" method='post'>< br>
<link rel="stylesheet " type="text/css" href="fyp.css" />
<b></b><br><br>
<table border="0">
<tr><td>Custome r Name:</td>
<td><input type="text" name ="customerna me" value ="<?php echo $customername; ?>"></td></tr>
<tr><td>Custome r Contact:</td>
<td><input type="text" name ="customerconta ct" value ="<?php echo $customercontac t; ?>"></td></tr>
<tr><td>Order ID:</td>
<td><input type="text" name ="orderid" value ="<?php echo $orderid; ?>"></td></tr>
<tr><td><inpu t 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(M ACHINE, USER, '');
mysql_select_db (DBNAME);
if (isset($_POST['submit']))
{
$customerid = $_GET['customerid'];
$customername = $_POST['customername'];
$customercontac t = $_POST['customercontac t'];
$orderid = $_POST['orderid'];
$sql = "UPDATE 'customer' SET 'customername' = '$customername' ,
'customercontac t' = '$customerconta ct','orderid' = '$orderid' WHERE 'customerid' = '$customerid'";
$result = mysql_query($sq l) or die ("Unable to Update Customer Information");
}
//echo "Customer Details has been updated from database.";
//<br><br>
//"<a href=cus_detail s.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 =)
<?
session_start() ;
require("db.php ");
mysql_connect(M ACHINE, USER, '');
mysql_select_db (DBNAME);
$username = $_SESSION['username'];
$pwd =$_SESSION['pwd'];
if(isset($usern ame)){
$customerid = $_POST['customerid'];
$customername = $_POST['customername'];
$customercontac t = $_POST['customercontac t'];
$orderid = $_POST['orderid'];
$sql = "SELECT * FROM customer";
$result = mysql_query($sq l) or die("Unable to get order info");
$row = mysql_fetch_ass oc($result);
extract($row);
}
?>
<html>
<head>
<title>Update Customer Details</title>
</head>
<body>
<form action="do_upda tecustomer.php? action=do_updat ecustomer&order id=<?php echo $orderid; ?>" enctype="multip art/form-data" method='post'>< br>
<link rel="stylesheet " type="text/css" href="fyp.css" />
<b></b><br><br>
<table border="0">
<tr><td>Custome r Name:</td>
<td><input type="text" name ="customerna me" value ="<?php echo $customername; ?>"></td></tr>
<tr><td>Custome r Contact:</td>
<td><input type="text" name ="customerconta ct" value ="<?php echo $customercontac t; ?>"></td></tr>
<tr><td>Order ID:</td>
<td><input type="text" name ="orderid" value ="<?php echo $orderid; ?>"></td></tr>
<tr><td><inpu t 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(M ACHINE, USER, '');
mysql_select_db (DBNAME);
if (isset($_POST['submit']))
{
$customerid = $_GET['customerid'];
$customername = $_POST['customername'];
$customercontac t = $_POST['customercontac t'];
$orderid = $_POST['orderid'];
$sql = "UPDATE 'customer' SET 'customername' = '$customername' ,
'customercontac t' = '$customerconta ct','orderid' = '$orderid' WHERE 'customerid' = '$customerid'";
$result = mysql_query($sq l) or die ("Unable to Update Customer Information");
}
//echo "Customer Details has been updated from database.";
//<br><br>
//"<a href=cus_detail s.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 =)
Comment