rondog Posted March 3, 2011 Share Posted March 3, 2011 I just need another pair of eyes as I am not seeing the syntax error. I'm sure I'll figure it out right after I post this as that has happened many times before. query: <?php $sql = " INSERT INTO views (user_id,show,show_id,episode,episode_id) VALUES ( '" . $_SESSION['user']['id'] . "', '" . $showTitle . "', '" . $showID . "', '" . $episodeTitle . "', '" . $episodeID . "')"; ?> output: <?php $output = " INSERT INTO views (user_id,show,show_id,episode,episode_id) VALUES ('1','Criminal Minds','9','Episode Title','1')"; ?> error: 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 'show,show_id,episode,episode_id) VALUES ( '1', 'Criminal Minds', '9',' at line 2 Link to comment https://forums.phpfreaks.com/topic/229523-cant-find-my-syntax-error/ Share on other sites More sharing options...
Pikachu2000 Posted March 3, 2011 Share Posted March 3, 2011 SHOW is a MySQL reserved word. Link to comment https://forums.phpfreaks.com/topic/229523-cant-find-my-syntax-error/#findComment-1182536 Share on other sites More sharing options...
rondog Posted March 3, 2011 Author Share Posted March 3, 2011 Ah..well that explains why I couldn't find the syntax error lol..thank you Link to comment https://forums.phpfreaks.com/topic/229523-cant-find-my-syntax-error/#findComment-1182537 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.