我執行使用Symfony2中和Doctrine2 ORM查詢執行INSERT,但我得到這個錯誤:「1064你在你的SQL錯誤」,而嘗試使用Symfony2中和Doctrine2
An exception occurred while executing 'INSERT INTO stock_detail_has_product_detail (content, created, modified, deletedAt, stock_detail, upc, product, condition, company, product_detail) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params ["Negro", "2013-09-29 02:54:46", "2013-09-29 02:54:46", null, 1, "AR024MHLXF83XZO3LQ78", 1, 1, 51, 1]:
SQLSTATE[42000]: Syntax error or access violation: 1064 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 'condition, company, product_detail) VALUES ('Negro', '2013-09-29 02:54:46', '201' at line 1
,我可以」找到造成這種情況的原因,我檢查了表格,列長度以及似乎沒問題,可以給我提供一些提示或指向正確的方向嗎?
PS:由學說內部產生該查詢,因爲我只保持對象到DB
從來沒有想過在這一點!這是問題! – Reynier
與單詞「** order **」(在sql保留字的列表中)有相同的問題。這種令人遺憾的是SQL異常並不明顯 –