2011-12-19 30 views
0

我找不到錯誤在此查詢:MySQL的語法錯誤「近「形容)」

INSERT INTO realestate ( 
type, offer, seller, area, build_area, price, is_negotiable, fur, floor_num, rooms, baths, year_built, phone, title, describe 
) VALUES ( 
'2', '1', '1', '98', '99887', '3242839', 'true', 'true', '1', '1', '1', '2010', '97854984576', 'lksehjfsed', 'alidjaopdhkljhdfkedfhwekdfhwseldfk') 

這是錯誤信息,我得到:

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 'describe) VALUES ('2', '1', '1', '98', '99887', '324' at line 2 
+0

的[可能重複我如何寫SQL的表與MySql中的受保護關鍵字共享一個名稱?](http://stackoverflow.com/questions/10706920/how-can-i-write-sql-for-a-table-that-shares-the-same -name-as-a-protected-keyword) – Jocelyn 2013-05-04 17:16:56

回答

6

DESCRIBEMySQL reserved keyword 。你需要,如果你使用它作爲列或表名括在反引號:

INSERT INTO realestate ( 
type, ...., floor_num, rooms, baths, year_built, phone, title, `describe` 
) VALUES ( 
'2', '1', '1', '98', '99887', '3242839', 'true', 'true', '1', '1', '1', '2010', '97854984576', 'lksehjfsed', 'alidjaopdhkljhdfkedfhwekdfhwseldfk') 

(列從列表中刪除可讀性)...

+0

或使用不同的單詞 – Strawberry 2013-05-04 17:18:24