Hi Guys,
I am having a problem with my sql code. I get an error message "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 'Smith St , suburb = Sydney , pcode = 2000 , ' at line 3.
I have tried the code below with the keyword AND in placde of the comma's, as well as AND before mfirstname, they both produce the same error. Yes I am trying to integrate this code with php.
php version : 5.2.6
sql version: 5.0.51b
on windows xp.
I am not sure if I am trying to update too many columns at a time or what.
any help would be appreciated.
Thanks and Regards
Anfo
here is my sql code.
$query = "UPDATE members SET msurname = " . mysql_real_escape_string(stripslashes($_POST['msurname'])) . " ,
mfirstname = " . mysql_real_escape_string(stripslashes($_POST['mfirstname'])) . " ,
address = " . mysql_real_escape_string(stripslashes($_POST['address'])) . " ,
suburb = " . mysql_real_escape_string(stripslashes($_POST['suburb'])) . " ,
pcode = " . mysql_real_escape_string(stripslashes($_POST['pcode'])) . " ,
home = " . mysql_real_escape_string(stripslashes($_POST['home'])) . " ,
work = " . mysql_real_escape_string(stripslashes($_POST['work'])) . " ,
mobile = " . mysql_real_escape_string(stripslashes($_POST['mobile'])) . " ,
email = " . mysql_real_escape_string(stripslashes($_POST['email'])) . "
WHERE member_id = $row[0] LIMIT 1";