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 ‘where cookieid = ‘3na0c1frfs2uo3gl462ajm0c1’)’ at line 1
I want to add the data provided where cookieid=users cookie. But it says the error above!
What happens is someone adds something to the basket. And when they do it saves their cookie value and product and quantity they have bought.
When they click proceed on the basket page, they then enter their name, telephone, address, etc. This information needs entering in the same row in the MySQL table as the their basket contents and cookie value. That is why I am adding this data where the cookie in the table matches the value in their computer.
I have tried your update idea. It does not work but may be it incorrectly coded:
$sql = "update cart set (emailaddress, firstname, lastname, address1, address2) to ('$emailaddress', '$firstname', '$lastname', '$address1', '$address2') where cookieid = '" . GetCartId() . "'";
What should I use? I believe I need to use WHERE but if i cannot use it with INSERT what can be done!?