Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/59.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 奇怪的错误您的SQL语法有错误_Php_Mysql - Fatal编程技术网

Php 奇怪的错误您的SQL语法有错误

Php 奇怪的错误您的SQL语法有错误,php,mysql,Php,Mysql,我试图将一个表单数据保存到一个表中,但它出现了mysql错误,我检查了所有的数据类型,所有其他事情都正常,这是我的mysql查询 INSERT INTO personal_events VALUES ( evt_date, evt_start, evt_end, evt_subject, evt_notes, evt_user ) VALUES ( '2013-03-29', '11', '12', 'test',

我试图将一个表单数据保存到一个表中,但它出现了mysql错误,我检查了所有的数据类型,所有其他事情都正常,这是我的mysql查询

 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 

有人能帮我解决这个问题吗

您有两个
。使用以下命令:

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
   )

您有两个
。使用以下命令:

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
   )

您需要使用该格式

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

列映射到数据库列,数据就是插入的数据。您的语句包含2个值,希望这有帮助。

您需要使用该格式

INSERT INTO personal_events (col1, col2, col3, col4) VALUES (data1, data2, data3, data4)
 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
   )
列映射到数据库列,数据就是插入的数据。您的语句包含2个值,希望这对您有所帮助

 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
   )
这是你的解决方案

这是你的解决方案