static314 发表于 2014-4-24 17:03:24

Sqlite insert 多笔数据会有错误

本帖最后由 static314 于 2014-4-24 17:05 编辑

Sqlite要insert多笔数据时,会报错误讯息,代码如下$sqlite= $this->load->database('sqlite',TRUE);$sql = “INSERTINTO area_list VALUES (1, '河南省'),(2,'河北省')”$sqlite->query($sql);  Fatalerror: Call to a member function execute() on a non-object inC:\wamp\www\menu\system\database\drivers\pdo\pdo_driver.php on line 193  pdo_driver.php193行 $result_id输出为空白   如果一笔一笔加入的话,就可以正常执行$sqlite= $this->load->database('sqlite',TRUE);$sql = “INSERTINTO area_list VALUES (1, '河南省')”$sqlite->query($sql);  pdo_driver.php193行 $result_id输出为PDOStatementObject ( => INSERT INTO area_list VALUES (1,'河南省') )  为什么使用PDO 的insert才会发生此问题呢??谢谢
页: [1]
查看完整版本: Sqlite insert 多笔数据会有错误