I'm not sure why its not updating, it is carrying the info over to the page, but its not changing the database info. Any ideas? mysql_query("UPDATE 'customer' SET 'Shop'=$Shop WHERE 'Cust_No'=$cust_no LIMIT 1"); PHP:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''customer' SET 'Shop'=Village Coi WHERE 'Cust_No'=3783 LIMIT 1' at line 1 Thanks for your help!
Yup... mysql_query("UPDATE 'customer' SET 'Shop'='$Shop' WHERE 'Cust_No'='$cust_no' LIMIT 1"); Code (markup): notice the single quotes around $Shop and $cust_no? Incidentally, all your other single quotes are unnecessary. So you could just have.... mysql_query("UPDATE customer SET Shop='$Shop' WHERE Cust_No='$cust_no' LIMIT 1"); Code (markup): You only really need to single quote table names and columns if they happen to be reserved words.
Like mentioned earlier by Nick, you don't need to use single quote for the table name. If still no luck try mysql_query("UPDATE `customer` SET `Shop` = '$Shop' WHERE `Cust_No` = '$cust_no' LIMIT 1");
mysql_query("UPDATE `customer` SET `Shop`='$Shop' WHERE `Cust_No`='".$cust_no."' LIMIT 1"); PHP: Will work If not use: mysql_query("UPDATE `customer` SET `Shop`='$Shop' WHERE `Cust_No`='".$cust_no."' LIMIT 1") or die(mysql_error()); PHP: and paste the error here;