我試過這個查詢,同時使用逗號和「AND」語句,如下圖所示。我收到語法錯誤PHP MySQL更新設置多個列的查詢
每次出錯了。您的SQL語法有錯誤;檢查對應於你的MySQL服務器版本的手冊正確的語法在1號線
附近'are available 24/7 by phone and email to answer any questions and to assist you '
使用我嘗試此查詢:
$sql = mysql_query("UPDATE general
SET bookabandheading = $_POST[bookabandheading
AND bookaband = $_POST[bookaband]
AND contactus = $_POST[contactus]
AND aboutuslisten = $_POST[aboutuslisten]
AND contactusheading = $_POST[contactusheading]
AND nightclubsheading = $_POST[nightclubsheading]
AND acousticheading = $_POST[acousticheading]
AND schoolsheading = $_POST[schoolsheading]
AND privateheading = $_POST[privateheading]
AND concertsheading = $_POST[concertsheading]
AND festivalsheading = $_POST[festivalsheading]
AND submissions = $_POST[submissions]
AND interns = $_POST[interns]
AND managementbio = $_POST[managementbio]
AND latestnews = $_POST[latestnews]
AND artistofthemonth = $_POST[artistofthemonth]
AND artistofthemonthphoto = $_POST[artistofthemonthphoto]
AND artistofthemonthid = $_POST[artistofthemonthid]
AND listentoourartists = $_POST[listentoourartists]
AND musicianswanted = $_POST[musicianswanted]
AND aboutus = $_POST[aboutus]
AND bshowcases = $_POST[bshowcases]
AND bandavails = $_POST[bandavails]");
查詢在不同的數據庫工作的另一VPS,但我只是遷移服務器,它不再有效。任何幫助都很有幫助!
如果你能在這裏粘貼確切的錯誤信息,這將有助於解決這個問題很多。 – aorcsik
出錯了。你的SQL語法有錯誤;請查看與您的MySQL服務器版本相對應的手冊,以找到正確的語法,以便在第1行「通過電話和電子郵件提供24/7全天候可用以回答任何問題並提供幫助」 – user2880653
此錯誤意味着, $ _POST包含字符串'...可用24/7 ...'等等,並且不允許在sql查詢中使用原始的,未轉義的,未加引號的字符串。 – aorcsik