techiefreak05 Posted November 4, 2006 Share Posted November 4, 2006 I'm not seeing any erros, are you?[code]if($_POST['zpageUPDATE']){$sql = "UPDATE `zpageInfo` SET `location` = '$_POST[location]', `film` = '$_POST[film]' `literature` = '$_POST[literature]' `music` = '$_POST[music]' `aboutme` = '$_POST[aboutme]' `friends` = '$_POST[friends]' WHERE `id` = '$_SESSION[id]'"; $query = mysql_query($sql) or die(mysql_error()); }[/code]as far as where the syntax is .. im getting this:[code]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 'literature` = '' `music` = '' `aboutme` = ''[/code] Link to comment https://forums.phpfreaks.com/topic/26138-mysql-says-theres-a-syntax-error/ Share on other sites More sharing options...
joshi_v Posted November 4, 2006 Share Posted November 4, 2006 [code]if($_POST['zpageUPDATE']){$sql = "UPDATE `zpageInfo` SET `location` = '$_POST[location]', `film` = '$_POST[film]' `literature` = '$_POST[literature]' `music` = '$_POST[music]' `aboutme` = '$_POST[aboutme]' `friends` = '$_POST[friends]' WHERE `id` = '$_SESSION[id]'"; $query = mysql_query($sql) or die(mysql_error()); }[/code]In the query you should separate each argument you want to update by using an " , " like this[code]$sql = "UPDATE `zpageInfo` SET `location` = '$_POST[location]', `film` = '$_POST[film]' , `literature` = '$_POST[literature]' , `music` = '$_POST[music]' , `aboutme` = '$_POST[aboutme]' , `friends` = '$_POST[friends]' WHERE `id` = '$_SESSION[id]'"; [/code]Regards,Joshi. Link to comment https://forums.phpfreaks.com/topic/26138-mysql-says-theres-a-syntax-error/#findComment-119532 Share on other sites More sharing options...
techiefreak05 Posted November 4, 2006 Author Share Posted November 4, 2006 !! Yeah thanks, i just noticed that! Ive been looking at code all day.. im tired. i cant believe i didnt c it!! Link to comment https://forums.phpfreaks.com/topic/26138-mysql-says-theres-a-syntax-error/#findComment-119533 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.