Insert_batch error - mysql


Insert_batch error - mysql

我有以下数组,用于使用Codeigniter的insert_batch插入数据库。

 Array
(
[td_customer_lphone] => Array
    (
        [0] => Array
            (
                [cust_lphone_id] => 
                [l_ph_cc] => +98
                [l_ph_ac] => 777
                [l_ph_no] => 77
            )
        [1] => Array
            (
                [cust_lphone_id] => 
                [l_ph_cc] => +78
                [l_ph_ac] => 66
                [l_ph_no] => 66
            )
    )

插入时会出现以下错误。

Error Number: 1054
Unknown column '0' in 'field list'
INSERT INTO `td_customer_lphone` (`0`, `1`) VALUES ('',''), ('+98','+78'), ('777','66'), ('77','66')

我做错了什么

谢谢你的帮助。。

您的语句中的(0,1)应该是您正在插入的字段名的列表-据我所知,您不能使用序数字段号

类似于(将字段1和字段2替换为表中列的名称

INSERT INTO td_customer_lphone (field1, field2) VALUES ('',''), ('+98','+78'), ('777','66'), ('77','66')