PHP Yii框架更新多条数据时简略网页超时
程序员文章站
2024-02-09 19:53:40
...
PHP Yii框架更新多条数据时容易网页超时。
如我要更新很多表时,网页容易超时
PLMH1::model()->updateAll(array('VISITNUM'=>'V'.$_POST['inputNum']),'SUBJID=:SUBJID AND VISITNUM=:VISITNUM',array(':SUBJID'=>$SUBJID,':VISITNUM'=>$VISITNUM));
PLMH2::model()->updateAll(array('VISITNUM'=>'V'.$_POST['inputNum']),'SUBJID=:SUBJID AND VISITNUM=:VISITNUM',array(':SUBJID'=>$SUBJID,':VISITNUM'=>$VISITNUM));
PLMH3::model()->updateAll(array('VISITNUM'=>'V'.$_POST['inputNum']),'SUBJID=:SUBJID AND VISITNUM=:VISITNUM',array(':SUBJID'=>$SUBJID,':VISITNUM'=>$VISITNUM));
PLMH4::model()->updateAll(array('VISITNUM'=>'V'.$_POST['inputNum']),'SUBJID=:SUBJID AND VISITNUM=:VISITNUM',array(':SUBJID'=>$SUBJID,':VISITNUM'=>$VISITNUM));
PLMH5::model()->updateAll(array('VISITNUM'=>'V'.$_POST['inputNum']),'SUBJID=:SUBJID AND VISITNUM=:VISITNUM',array(':SUBJID'=>$SUBJID,':VISITNUM'=>$VISITNUM));
PLMH6::model()->updateAll(array('VISITNUM'=>'V'.$_POST['inputNum']),'SUBJID=:SUBJID AND VISITNUM=:VISITNUM',array(':SUBJID'=>$SUBJID,':VISITNUM'=>$VISITNUM));
PLMH7::model()->updateAll(array('VISITNUM'=>'V'.$_POST['inputNum']),'SUBJID=:SUBJID AND VISITNUM=:VISITNUM',array(':SUBJID'=>$SUBJID,':VISITNUM'=>$VISITNUM));
PLMH8::model()->updateAll(array('VISITNUM'=>'V'.$_POST['inputNum']),'SUBJID=:SUBJID AND VISITNUM=:VISITNUM',array(':SUBJID'=>$SUBJID,':VISITNUM'=>$VISITNUM));
PLSU::model()->updateAll(array('VISITNUM'=>'V'.$_POST['inputNum']),'SUBJID=:SUBJID AND VISITNUM=:VISITNUM',array(':SUBJID'=>$SUBJID,':VISITNUM'=>$VISITNUM));
PLPE::model()->updateAll(array('VISITNUM'=>'V'.$_POST['inputNum']),'SUBJID=:SUBJID AND VISITNUM=:VISITNUM',array(':SUBJID'=>$SUBJID,':VISITNUM'=>$VISITNUM));
PLLB1::model()->updateAll(array('VISITNUM'=>'V'.$_POST['inputNum']),'SUBJID=:SUBJID AND VISITNUM=:VISITNUM',array(':SUBJID'=>$SUBJID,':VISITNUM'=>$VISITNUM));
PLLB2::model()->updateAll(array('VISITNUM'=>'V'.$_POST['inputNum']),'SUBJID=:SUBJID AND VISITNUM=:VISITNUM',array(':SUBJID'=>$SUBJID,':VISITNUM'=>$VISITNUM));
PLLB3::model()->updateAll(array('VISITNUM'=>'V'.$_POST['inputNum']),'SUBJID=:SUBJID AND VISITNUM=:VISITNUM',array(':SUBJID'=>$SUBJID,':VISITNUM'=>$VISITNUM));
PLLB4::model()->updateAll(array('VISITNUM'=>'V'.$_POST['inputNum']),'SUBJID=:SUBJID AND VISITNUM=:VISITNUM',array(':SUBJID'=>$SUBJID,':VISITNUM'=>$VISITNUM));
PLLB5::model()->updateAll(array('VISITNUM'=>'V'.$_POST['inputNum']),'SUBJID=:SUBJID AND VISITNUM=:VISITNUM',array(':SUBJID'=>$SUBJID,':VISITNUM'=>$VISITNUM));
PLLB6::model()->updateAll(array('VISITNUM'=>'V'.$_POST['inputNum']),'SUBJID=:SUBJID AND VISITNUM=:VISITNUM',array(':SUBJID'=>$SUBJID,':VISITNUM'=>$VISITNUM));
PLLB7::model()->updateAll(array('VISITNUM'=>'V'.$_POST['inputNum']),'SUBJID=:SUBJID AND VISITNUM=:VISITNUM',array(':SUBJID'=>$SUBJID,':VISITNUM'=>$VISITNUM));
PLLB8::model()->updateAll(array('VISITNUM'=>'V'.$_POST['inputNum']),'SUBJID=:SUBJID AND VISITNUM=:VISITNUM',array(':SUBJID'=>$SUBJID,':VISITNUM'=>$VISITNUM));
PLCO::model()->updateAll(array('VISITNUM'=>'V'.$_POST['inputNum']),'SUBJID=:SUBJID AND VISITNUM=:VISITNUM',array(':SUBJID'=>$SUBJID,':VISITNUM'=>$VISITNUM));
错识提示如下:
Fatal error: Maximum execution time of 30 seconds exceeded in D:\web_root\rd1039b\framework\db\CDbCommand.php on line 496
请问YII有其它比较快的更新方法吗?
谢谢!
------解决方案--------------------
set_time_limit(0) 不限时
如我要更新很多表时,网页容易超时
PLMH1::model()->updateAll(array('VISITNUM'=>'V'.$_POST['inputNum']),'SUBJID=:SUBJID AND VISITNUM=:VISITNUM',array(':SUBJID'=>$SUBJID,':VISITNUM'=>$VISITNUM));
PLMH2::model()->updateAll(array('VISITNUM'=>'V'.$_POST['inputNum']),'SUBJID=:SUBJID AND VISITNUM=:VISITNUM',array(':SUBJID'=>$SUBJID,':VISITNUM'=>$VISITNUM));
PLMH3::model()->updateAll(array('VISITNUM'=>'V'.$_POST['inputNum']),'SUBJID=:SUBJID AND VISITNUM=:VISITNUM',array(':SUBJID'=>$SUBJID,':VISITNUM'=>$VISITNUM));
PLMH4::model()->updateAll(array('VISITNUM'=>'V'.$_POST['inputNum']),'SUBJID=:SUBJID AND VISITNUM=:VISITNUM',array(':SUBJID'=>$SUBJID,':VISITNUM'=>$VISITNUM));
PLMH5::model()->updateAll(array('VISITNUM'=>'V'.$_POST['inputNum']),'SUBJID=:SUBJID AND VISITNUM=:VISITNUM',array(':SUBJID'=>$SUBJID,':VISITNUM'=>$VISITNUM));
PLMH6::model()->updateAll(array('VISITNUM'=>'V'.$_POST['inputNum']),'SUBJID=:SUBJID AND VISITNUM=:VISITNUM',array(':SUBJID'=>$SUBJID,':VISITNUM'=>$VISITNUM));
PLMH7::model()->updateAll(array('VISITNUM'=>'V'.$_POST['inputNum']),'SUBJID=:SUBJID AND VISITNUM=:VISITNUM',array(':SUBJID'=>$SUBJID,':VISITNUM'=>$VISITNUM));
PLMH8::model()->updateAll(array('VISITNUM'=>'V'.$_POST['inputNum']),'SUBJID=:SUBJID AND VISITNUM=:VISITNUM',array(':SUBJID'=>$SUBJID,':VISITNUM'=>$VISITNUM));
PLSU::model()->updateAll(array('VISITNUM'=>'V'.$_POST['inputNum']),'SUBJID=:SUBJID AND VISITNUM=:VISITNUM',array(':SUBJID'=>$SUBJID,':VISITNUM'=>$VISITNUM));
PLPE::model()->updateAll(array('VISITNUM'=>'V'.$_POST['inputNum']),'SUBJID=:SUBJID AND VISITNUM=:VISITNUM',array(':SUBJID'=>$SUBJID,':VISITNUM'=>$VISITNUM));
PLLB1::model()->updateAll(array('VISITNUM'=>'V'.$_POST['inputNum']),'SUBJID=:SUBJID AND VISITNUM=:VISITNUM',array(':SUBJID'=>$SUBJID,':VISITNUM'=>$VISITNUM));
PLLB2::model()->updateAll(array('VISITNUM'=>'V'.$_POST['inputNum']),'SUBJID=:SUBJID AND VISITNUM=:VISITNUM',array(':SUBJID'=>$SUBJID,':VISITNUM'=>$VISITNUM));
PLLB3::model()->updateAll(array('VISITNUM'=>'V'.$_POST['inputNum']),'SUBJID=:SUBJID AND VISITNUM=:VISITNUM',array(':SUBJID'=>$SUBJID,':VISITNUM'=>$VISITNUM));
PLLB4::model()->updateAll(array('VISITNUM'=>'V'.$_POST['inputNum']),'SUBJID=:SUBJID AND VISITNUM=:VISITNUM',array(':SUBJID'=>$SUBJID,':VISITNUM'=>$VISITNUM));
PLLB5::model()->updateAll(array('VISITNUM'=>'V'.$_POST['inputNum']),'SUBJID=:SUBJID AND VISITNUM=:VISITNUM',array(':SUBJID'=>$SUBJID,':VISITNUM'=>$VISITNUM));
PLLB6::model()->updateAll(array('VISITNUM'=>'V'.$_POST['inputNum']),'SUBJID=:SUBJID AND VISITNUM=:VISITNUM',array(':SUBJID'=>$SUBJID,':VISITNUM'=>$VISITNUM));
PLLB7::model()->updateAll(array('VISITNUM'=>'V'.$_POST['inputNum']),'SUBJID=:SUBJID AND VISITNUM=:VISITNUM',array(':SUBJID'=>$SUBJID,':VISITNUM'=>$VISITNUM));
PLLB8::model()->updateAll(array('VISITNUM'=>'V'.$_POST['inputNum']),'SUBJID=:SUBJID AND VISITNUM=:VISITNUM',array(':SUBJID'=>$SUBJID,':VISITNUM'=>$VISITNUM));
PLCO::model()->updateAll(array('VISITNUM'=>'V'.$_POST['inputNum']),'SUBJID=:SUBJID AND VISITNUM=:VISITNUM',array(':SUBJID'=>$SUBJID,':VISITNUM'=>$VISITNUM));
错识提示如下:
Fatal error: Maximum execution time of 30 seconds exceeded in D:\web_root\rd1039b\framework\db\CDbCommand.php on line 496
请问YII有其它比较快的更新方法吗?
谢谢!
------解决方案--------------------
set_time_limit(0) 不限时
相关文章
相关视频
上一篇: php中计算时间差的几种方法_php技巧
下一篇: PHP自定义函数如何传值过去