I have a html form on another page that is automatically filled from data from the table. I then run the the following script on submit to update the row if any information is changed. Here is the code
<?php
$db=mysql_connect ("connection info") or die ('I cannot connect to the database because: ' . mysql_error());
$mydb=mysql_select_db("databasename");
$OrderID = $_POST['OrderID'];
$CompanyID = $_POST['CompanyID'];
$CoPhone = $_POST['CoPhone'];
$CustomerID = $_POST['OrderID'];
$Customer = $_POST['CompanyID'];
$Address = $_POST['CoPhone'];
$City = $_POST['OrderID'];
$State = $_POST['CompanyID'];
$ZipCode = $_POST['CoPhone'];
$Telephone = $_POST['OrderID'];
$ServiceCategory = $_POST['CompanyID'];
$DateCall = $_POST['CoPhone'];
$WStatus = $_POST['WStatus'];
$result = mysql_query("UPDATE TableName SET OrderID='$OrderID', CompanyID='$CompanyID', CoPhone='$CoPhone', CustomerID='$CustomerID', Address='$Address', City='$City', State='$State', ZipCode='$ZipCode', Telephone='$Telephone', ServiceCategory='$ServiceCategory, DateCall='$DateCall', WStatus='$Wstatus' WHERE OrderID='$OrderID'");
if (!$result) {
die("oh snap I got an error. It is ".mysql_error());
}
?>
This is my first update script and I can't get it to work...I'm pretty sure it's something simple. Any help is appreciated!