Advertisement
Guest User

Untitled

a guest
May 30th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. foreach ($tables as $table) {
  2. $rowsleft = 2;
  3. $fp = fopen($table.'.csv', 'w');
  4. $min = 0;
  5. $max = 100;
  6. while ($rowsleft > 0) {
  7. echo 'We do this?';
  8. $result = $mysqli->query("SELECT * FROM $table limit $min, $max");
  9. --$rowsleft;
  10. echo $result->num_rows;
  11. echo 'Rows.';
  12. while ($row = $result->fetch_assoc()) {
  13. fputcsv($fp, $row);
  14. }
  15. $min = $min + 100;
  16. $max = $max + 100;
  17. $result = '';
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement