Hello,
I'm sorry my English is bad
List the name of the table is okay, no problem,
Problem, Number of insert rows of each table ?, How do I get?
Can you help?
<table>
<tr>
<th>Order</th>
<th>Table Name</th>
<th>Rows</th>
</tr>
<?php
$lines = file('backup.sql');
$search = 'CREATE TABLE '; // CREATE TABLE `table_name` (
$insert_search = 'INSERT INTO '; // INSERT INTO `tablename` VALUES('24','2','14');
$found = false;
$i = 1;
foreach($lines as $line){
if(strpos($line, $search) !== false){
$found = true;
$rawdata = explode("\n", $line);
$data = explode("`", $rawdata[0]);
array_pop($data);
$tablename = array_pop($data);
?>
<tr>
<td style="text-align:right;"><b><?=$i?></b></td>
<td style="text-align:left;"><?=ucfirst(strtolower($tablename))?></td>
<td style="text-align:right;">Number of insert rows of each table ?</td>
</tr>
<?php
$i++;
unset($tablename, $line, $data, $rawdata);
} // if(strpos($line, $search) !== false){
} // foreach($lines as $line){
?>
</table>
Sample output:
[ATTACH=CONFIG]5115[/ATTACH]
Thank you in advance
Best Regards
1PdnqB.png