PHP Yii框架更新多条数据时简略网页超时
程序员文章站
2022-05-25 15:35: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) 不限时
相关文章
相关视频
上一篇: 阿里云能设置域名吗
下一篇: 根据国家获取当地当前的时间