Jump to content

Can't find my syntax error


rondog

Recommended Posts

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

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.