当前位置:Gxlcms > PHP教程 > PHP批量更新数据库的示例代码

PHP批量更新数据库的示例代码

时间:2021-07-01 10:21:17 帮助过:22人阅读

  1. /**
  2. * 批量更新数据库
  3. * by bbs.it-home.org
  4. */
  5. for($i=1;$i<=$this->size;$i++){
  6. $query[]="update tb_enterprise set eid='$eidex[$i]' where eid=$i";
  7. }
  8. $query_string=implode(";", $query);
  9. $query_result=$db->multi_query($query);
  10. if($query_result){
  11. echo "Successed to update data!";
  12. }else{
  13. echo "Failed to update data!";
  14. }

人气教程排行