【发布时间】:2014-11-24 17:05:58
【问题描述】:
我正在尝试通过 codeigniter 将一些数据插入数据库,但遇到了一些奇怪的错误。有谁知道原因:
我的插入数组($datainsert)在打印时如下:
Array ( [online_name] => Discount Store
[online_nameKey] => d
[storeGroup_ID] =>
[CJ_ID] => 123456
[online_tag] => Health and Medical
[online_businessType] => 0
[online_businessTypeSub] => 0
[online_homepage] => http://www.discountstore.com
[store_ChainID] =>
[savingsdotcom_ID] => 0 )
尝试打印我使用的插页:
echo $DB1->_insert('stores_online', $datainsert);
结果:
INSERT INTO stores_online (Discount Store, d, , 123456, Health and Medical, 0, 0, http://www.discountstore.com, , 0) VALUES ()
我不明白为什么它没有正确使用数组键作为第一个 () 和值。
【问题讨论】:
-
你遇到了什么“奇怪的错误”?
-
有什么错误?
-
它只是发出 500 DB 错误,即使我已将所有错误设置为显示并将其放入 try/catch 循环中。但是很明显insert语句格式不正确。
标签: php mysql codeigniter codeigniter-2