How to use PHP batch processing MySQL data? I hope the master can give the code directly, thank you

Source: Internet
Author: User
How do I bulk process mysql data using PHP? Hope that the master can directly give the code, thank you!
For example, there are several data in the database that want to add and insert two fields from each piece of data into another field:

CCA CCB CCD ID
45 66 0 1
67 36 0 2
86 24 0 5
76 84 0 8
6 55 0 12
......

The single calculation is as follows:
 
 Require_once ("header.php");

$q = "SELECT * from member where id= ' 5";
$r = $obj _db->simplequery ($q);
$a = $obj _db->fetchrow ($r, DB_FETCHMODE_ASSOC);

$CCD = $a [cca]+ $a [CCB];

$obj _db->simplequery ("Update member set ccd= ' $CCD ' where id= ' 5 '");
?>


Is there any way to calculate each piece of data in batches at once? Please give the detailed code, thank you!
------Solution--------------------
$obj _db->simplequery ("Update member set CCD=CCA+CCB");
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.