毫無疑問,我的思念很簡單的東西在這裏,但我看不出這個問題與此查詢其產生以下錯誤:簡單的MySQL INSERT錯誤
SQL query:
INSERT INTO ads(
ad_id, author, ad_date, category, title,
description, condition, price, fullname,
telephone, email, status, photo, photothumb
)
VALUES (
NULL , 'justal', '1225790938', 'Windsurf Boards',
'test', 'test', 'Excellent', '12', 'test',
'test', 'test', '', '', ''
);
MySQL said: Documentation
#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 ''ad_id', 'author',
'ad_date', 'category', 'title', 'description',
'condition', '' at line 1
有人可以用新鮮的對眼睛發現問題?
謝謝, 鋁。
是的,但沒有使用引號的都是eassier讀取(如果你的列名是這樣的,你需要說出來了,你選擇錯誤的列名) – 2008-11-04 10:01:08
我完全不同意。在任何時候使用反引號都非常適合可讀性,並且當完美名稱是「關鍵」,「值」等時,您不必爲字段組成任意名稱。 – nickf 2008-11-04 10:03:14