0

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()); 
3
  • 6
    You have an extra comma in your statement, just before the WHERE. Commented Nov 28, 2013 at 20:52
  • Can you print your query in full? Commented Nov 28, 2013 at 20:52
  • Use mysqli/pdo and prepared statements, or at least put every SQL token on a new line, improving readability also makes it easier to detect those syntax errors. Commented Nov 28, 2013 at 21:17

2 Answers 2

1
$sql = mysql_query("UPDATE [...] bio='$bio2', WHERE agentclient = '$agentclient2'")[...]
                                            ^ this is wrong
Sign up to request clarification or add additional context in comments.

Comments

0

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()); 

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.