Jump to content

MySQL UPDATE error


aeboi80

Recommended Posts

For the life of me I cannot figure out what I have mistyped.  I am trying to do a simple UPDATE query.

 

Here is the error which I am getting:

 

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 '(`first_name`, `last_name`, `email`, `address1`, `address2`, `city`, `stat' at line 1

 

 

Here is the PHP and SQL statement:

 

$firstName = ucwords(protect($_POST['first_name']));
$lastName = ucwords(protect($_POST['last_name']));
$email = protect($_POST['email']);
$address1 = ucwords(protect($_POST['address1']));
$address2 = protect($_POST['address2']);
$city = protect($_POST['city']);
$state = protect($_POST['state']);
$zip = protect($_POST['zip']);
$country = protect($_POST['country']);
$phone = protect($_POST['phone']);

$res2 = mysql_query("UPDATE ".DB_TABLE_PREFIX . "members SET(`first_name`, `last_name`, `email`, `address1`, `address2`,
				`city`, `state`, `zip`, `country`, `phone`)
				VALUES('".$firstName."','".$lastName."','".$email."','".$address1."','".$address2."','".$city."','".$state."',
				'".$zip."','".$country."','".$phone."') WHERE username = '".$_SESSION['loggedin_username']."'") or die(mysql_error());

 

Link to comment
https://forums.phpfreaks.com/topic/207050-mysql-update-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.