用一個簡單的插入命令掙扎,我得到的錯誤MYSQL語法 - Insert語句
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"
基本上通過資料片成表,這裏是代碼 -
$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());
謝謝你們
'$ Film_Name''這個位缺少開頭引號,我相信 – Dale 2012-04-17 23:26:30
您還應該通過'mysql_real_escape_string()'而不是par-sey查看您可能擁有的任何sql注入,但要轉義會破壞您的查詢的任何引號等。 – 2012-04-17 23:35:56