hi guys. i'm having problem with this code (again)
$insert = "INSERT INTO movie (movie_id, movie_name, movie_type, " .
"movie_year, movie_leadActor, movie_director) " .
"VALUES (1, 'Bruce Almighty', 5, 2003, 1, 2), " .
"(2, 'Office Space', 5, 1999, 5, 6), " .
"(3, 'Grand Canyon', 2, 1991, 4, 31)";
$results=mysql_query($insert)
or die(mysql_error());
// insert data into "movieType" table
$insert ="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());
//insert data into "people" table
$people = "INSERT INTO people (people_id, people_fullName, " .
"people_isActor, people_isDirector) " .
"VALUES (1, 'Jim Carey', 1, 0), " .
"(2, 'Tom Shadyac', 0, 1), " .
"(3, 'Lawrence Kasdan', 0, 1), " .
"(4, 'Kevin Kline', 1, 0), " .
"(5, 'Ron Livingston', 1, 0), " .
"(6, 'Mike Judge', 0, 1)";
$results=mysql_query($people)
or die(mysq_error());
echo "data inserted successfully";
?>
i open the file in my browser and it just shows 'query was empty'.
I've commented out all of the $results=mysql_query sections and then the date is inserted ok. i went back an uncommented-out the $results sections and it seems as though it's the middle one
$results=mysql_query($type)
or die(mysql_error());
causing the problems (i started from the bottom and worked up, so it may be that the top one causes issues too!).
can anyone help?