我试图通过codeigniter向数据库中插入一些数据,但遇到一些奇怪的错误。有谁知道原因: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()
我不明白为什么它没有正确使用数组键的第一个()和值。
你会得到什么“奇怪的错误”? – 2014-11-24 17:10:49
有什么错误? – 2014-11-24 17:14:24
即使我将所有错误设置为显示并将其放入try/catch循环,它也只是输出500 DB错误。但很明显,insert语句格式不正确。 – user2694306 2014-11-24 17:42:38