Hi all,
Below is a snippet of code.
Can anyone see why this would produce an error, specifically the line: $the_id = mysql_insert_id($result2);
$sql_query ="INSERT INTO movie (movie_title, movie_pitch, movie_release_year, movie_duration, movie_classification) VALUES ('$movie_title','$movie_pitch','$movie_release_year','$movie_duration','$movie_classification')";
$result = mysql_query($sql_query);
foreach ( $matches[1] as $genre_id ){
$sql_query2 ="INSERT INTO movie_genre (movie_id, genre_id) VALUES (LAST_INSERT_ID(),'$genre_id')";
$result2 = mysql_query($sql_query2);
$the_id = mysql_insert_id($result2);
}
if($result || $result2){
echo "<div align=\"center\">";
echo "The <b>movie</b> title was uploaded successfully $the_id";
Cheers,
micmac