这是我的插入查询。
$insertQuery = "INSERT INTO timeline (id_str, from_user, text, timestamp, location) VALUES ($resultsAry[$x]['id_str'], $resultsAry[$x]['from_user'], $resultsAry[$x]['text'], $datetime, $locationAry[$i]['place'])";
传递给查询的值似乎是正确的(通过回显所有值进行检查)。但我犯了以下错误。
Insert failed: 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 '['id_str'], Array['from_user'], Array['text'], 2011-05-23 18:58:27, Array['place' at line 1
请帮忙?
最佳答案
试试这个:
$insertQuery = "INSERT INTO timeline (id_str, from_user, text, timestamp, location) VALUES ('".$resultsAry[$x]['id_str']."', '".$resultsAry[$x]['from_user']."', '".$resultsAry[$x]['text']."', '".$datetime."', '".$locationAry[$i]['place']."')";