<?php $database = "starter_mag"; $password = "XXXXXXX"; $username = "XXXXXXX"; $hostname = "127.0.0.1"; $link = mysqli_connect($hostname, $username, $password, $database); if($link === false){ die("ERROR: Could not connect. " . mysqli_connect_error()); } $sql = "SELECT distinct TABLE_NAME FROM Information_schema.columns where TABLE_SCHEMA = '$database' ORDER BY table_name ASC"; $offset = 10000; if($result = mysqli_query($link, $sql)){ if(mysqli_num_rows($result) > 0){ while($row = mysqli_fetch_array($result)){ $tableName = $row['TABLE_NAME']; $count = 0; echo '------------------- INIT '.$tableName.' TABLE ---------------'.PHP_EOL; do{ $tableQuery = "SELECT * FROM ".$tableName." limit ".$count*$offset.", $offset"; if($resultTableQuery = mysqli_query($link, $tableQuery)) { if (mysqli_num_rows($resultTableQuery) > 0) { while ($tableRow = mysqli_fetch_array($resultTableQuery)) { echo ('('.$count.') '.$tableName.': '); echo implode(',',$tableRow); echo PHP_EOL; } } } $count++; }while(mysqli_num_rows($resultTableQuery)); echo '------------------- END '.$tableName.' TABLE ---------------'.PHP_EOL; } mysqli_free_result($result); } } else{ echo "ERROR: Could not able to execute $sql. " . mysqli_error($link); } mysqli_close($link);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)