A.R
A.R

Reputation: 135

Error in MYSQL syntax with WHERE command

Getting this error-

Not sure why, I have looked over it several of times.

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 agentclient = 'admin'' at line 1

In this code-

$sql = mysql_query("UPDATE agentclient SET email='$email2', phone='$phone2', Streetaddress='$address2', faxnumber='$faxnumber2', website='$website2', bio='$bio2', WHERE agentclient = '$agentclient2'") or die(mysql_error()); 

Upvotes: 0

Views: 31

Answers (2)

Joaquín O
Joaquín O

Reputation: 1451

$sql = mysql_query("UPDATE [...] bio='$bio2', WHERE agentclient = '$agentclient2'")[...]
                                            ^ this is wrong

Upvotes: 1

NiMeDia
NiMeDia

Reputation: 1004

The comma before where is wrong, try:

$sql = mysql_query("UPDATE agentclient SET email='$email2', phone='$phone2', Streetaddress='$address2', faxnumber='$faxnumber2', website='$website2', bio='$bio2' WHERE agentclient = '$agentclient2'") or die(mysql_error()); 

Upvotes: 0

Related Questions