Yii-SQLSTATE[HY000]但执行了查询
我试图在我的Yii应用程序中执行多重SQL插入:Yii-SQLSTATE[HY000]但执行了查询,sql,yii,phpmyadmin,Sql,Yii,Phpmyadmin,我试图在我的Yii应用程序中执行多重SQL插入: INSERT INTO take_lf (data, start, end) VALUES ('take1.csv', '0', '0'), ('take2.csv', '0', '0'), ('take3.csv', '0', '0') 执行查询时,我可以在PhpMyAdmin上看到结果,但在Yii上出现错误: CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]:
INSERT INTO take_lf (data, start, end)
VALUES ('take1.csv', '0', '0'), ('take2.csv', '0', '0'), ('take3.csv', '0', '0')
执行查询时,我可以在PhpMyAdmin上看到结果,但在Yii上出现错误:
CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]: General error
有人知道问题出在哪里吗?我查找了PhpMyAdmin登录状态->监视器,但没有找到任何内容
编辑:跟踪如下所示
#0 /volume1/web/yii/framework/db/CDbCommand.php(395): CDbCommand->queryInternal("fetchAll", array(2), array())
#1 /volume1/web/dbcremona/protected/controllers/TakeLF.php(253): CDbCommand->queryAll()
251 }
252 $sql = substr($sql, 0, -1); //tolgo ultima virgola
253 $r = Yii::app()->db->createCommand($sql)->queryAll();**
254 echo $r;
255 }
256
257 /**
258 * Returns the data model based on the primary key given in the GET variable.
#2 /volume1/web/yii/framework/web/actions/CInlineAction.php(49): TakeLFController->actionInsert_multiple()
#3 /volume1/web/yii/framework/web/CController.php(308): CInlineAction->runWithParams(array("r" => "takeLF/insert_multiple"))
#4 /volume1/web/yii/framework/web/filters/CFilterChain.php(133): CController->runAction(CInlineAction)
#5 /volume1/web/yii/framework/web/filters/CFilter.php(40): CFilterChain->run()
#6 /volume1/web/yii/framework/web/CController.php(1145): CFilter->filter(CFilterChain)
#7 /volume1/web/yii/framework/web/filters/CInlineFilter.php(58): CController->filterAccessControl(CFilterChain)
#8 /volume1/web/yii/framework/web/filters/CFilterChain.php(130): CInlineFilter->filter(CFilterChain)
#9 /volume1/web/yii/framework/web/CController.php(291): CFilterChain->run()
#10 /volume1/web/yii/framework/web/CController.php(265): CController->runActionWithFilters(CInlineAction, array("accessControl", "postOnly + delete"))
#11 /volume1/web/yii/framework/web/CWebApplication.php(282): CController->run("insert_multiple")
#12 /volume1/web/yii/framework/web/CWebApplication.php(141): CWebApplication->runController("takeLowFeature/insert_multiple")
#13 /volume1/web/yii/framework/base/CApplication.php(169): CWebApplication->processRequest()
你能发布异常跟踪吗?嗨,我编辑了我的帖子,我不知道你是不是这个意思。