Home > Backend Development > PHP Tutorial > PHP sample code to update database in batches

PHP sample code to update database in batches

WBOY
Release: 2016-07-25 08:55:25
Original
1006 people have browsed it
  1. /**
  2. * Batch update database
  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. }
复制代码


source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template