2014-03-29 58 views
0

進出口特林表單數據保存到一個表,但它使MySQL錯誤,我查everywhwre數據類型和所有其他的事情都是好的,這是我的MySQL查詢奇怪的錯誤,您在您的SQL語法錯誤

INSERT INTO personal_events 
     VALUES (
     evt_date, evt_start, evt_end, evt_subject, evt_notes, evt_user 
     ) 
     VALUES (
     '2013-03-29', '11', '12', 'test', 'test notess', 21 
     ) 

錯誤的詳細信息

#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 'VALUES('2013-03-29', '11', '12', 'test', 'test notess', 21)' at line 1 

誰能幫助我解決這個

回答

3

你有兩個VALUES。使用以下命令:

INSERT INTO personal_events 
    (
    evt_date, evt_start, evt_end, evt_subject, evt_notes, evt_user 
    ) 
    VALUES (
    '2013-03-29', '11', '12', 'test', 'test notess', 21 
    ) 
1

您需要使用的格式

INSERT INTO personal_events (col1, col2, col3, col4) VALUES (data1, data2, data3, data4) 

的列映射到數據庫列時,的數據都是你插入數據。你的陳述包含2個值,希望這有助於。

0
INSERT INTO personal_events 
    (
    evt_date, evt_start, evt_end, evt_subject, evt_notes, evt_user 
    ) 
    VALUES (
    '2013-03-29', '11', '12', 'test', 'test notess', 21 
    ) 

這是您的解決方案

相關問題