这是我的插入查询。无法在PHP中使用MySql插入数据
$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
请帮忙?
我认为您需要引用您的值。 – martynthewolf 2011-05-23 11:07:13