Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.33 KB | None | 0 0
  1. $i = 0;
  2. $ii = 0;
  3. $queries = array();
  4. foreach ($array as $key) {
  5.  
  6.     if ($i > 5) {
  7.         $i = 0;
  8.         $ii++;
  9.         $queries[$ii] = "INSERT INTO xx (row1,row2,row3) VALUES ";
  10.     }
  11.     $values = "(" . $key["row1"] . "," . $key["row2"] . "," . $key["row3"] . ") ";
  12.     $queries[$ii] .= $values;
  13.    
  14.     $i++;
  15.  
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement