SQL syntax error - Chapter 3
Hi,
I received the following message in creating the moviedata file:
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 '. (6, 'Horror'), (7, 'Action'), (8, 'Kids')' at line 1
Here is the excerpted code:
//insert data into "movietype" table
$type = "INSERT INTO movietype (movietype_id, movietype_label) " .
"VALUES (1, 'Sci Fi'), " .
"(2, 'Drama'), " .
"(3, 'Adventure'), " .
"(4, 'War'), " .
"(5, 'Comedy'), " .
"(6, 'Horror'), " .
"(7, 'Action'), " .
"(8, 'Kids')";
$results = mysql_query($type)
or die(mysql_error());
I had mistakenly put in a period instead of a comma after War and had the error initially. I went back and changed to a comma and still get an error. Where is the error???
Thanks!
|