DIM3NSION
DIM3NSION

Reputation: 1761

MYSQL Syntax - Insert statement

Struggling with a simple insert command, i'm getting the 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 'All In: 
The Poker Movie, tells the story of poker focusing on why one of our nat' 
at line 2"

Basically passing film information into a table, here is the code -

$query1 = "INSERT INTO Films_Info (Films_ID,FilmName, FilmRelease, Synopsis,Poster,CritScore,AudScore,Director,Studio,IMDB,date_added_db) 
VALUES ('',$Film_Name', '$Film_Release','$filmsynopsis','$film_image','$film_critic','$film_audience','$film_director','$film_studio','$film_imdbID','')";
$runquery1 = mysql_query($query1)or die(mysql_error()); 

Thanks guys

Upvotes: 1

Views: 226

Answers (2)

Jay
Jay

Reputation: 2569

If you have phpmyadmin enabled on you server, you can paste the code into the SQL-Field to get syntax highlighting on the SQL query.

Upvotes: 1

David Z.
David Z.

Reputation: 5701

It looks like that you are missing an ' before $Film_Name. Can you add the missing apostrophe?

Upvotes: 7

Related Questions