lmcgr44 Posted February 15, 2011 Share Posted February 15, 2011 hello when i run the script i get 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 'title` ,`prep` ,`cook` ,`makes` ,`ingredients` ,`recipe` ,`notes`)VALUES ('lmcgr' at line 1 this is the part of the code it is telling me to check andy ideas why its tlling me? function AddRecipe($user,$Pub,$title,$prep,$cook,$make,$ingr,$desc, $note){ if(!TRACK_VISITORS) return; $q = "INSERT INTO recipies (`user` ,`Pub ,`title` ,`prep` ,`cook` ,`makes` ,`ingredients` ,`recipe` ,`notes`)VALUES ('$user', '$Pub', '$title', 'prep', 'cook','$make', '$ingr', '$desc', '$note');"; mysql_query($q, $this->connection) or die(mysql_error()); $this->calcNumActiveGuests(); } Link to comment https://forums.phpfreaks.com/topic/227702-error-in-sql-syntax/ Share on other sites More sharing options...
btherl Posted February 15, 2011 Share Posted February 15, 2011 You forgot a "`" after Pub. Link to comment https://forums.phpfreaks.com/topic/227702-error-in-sql-syntax/#findComment-1174361 Share on other sites More sharing options...
phppaper Posted February 15, 2011 Share Posted February 15, 2011 as well as ` to ' Link to comment https://forums.phpfreaks.com/topic/227702-error-in-sql-syntax/#findComment-1174369 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.