Show table name and rows

Hello,

No problem showing of table names.

How do I show the total number of rows?

[php]

<?php $result = $mysqlibag->query("show tables"); while($table = $result->fetch_array()) { $num_fields = $result->field_count; echo "Table name:".$table[0]." Rows:".$num_fields."
"; } ?>

[/php]

Best Regards

I think the easiest method in this case would be to do a query for the table-count first. Just something like:

SELECT COUNT(*) FROM information_schema.tables WHERE TABLE_SCHEMA = 'database_name'

Thank you for the answer

I am using the " include “config.php”; "

Not the number of tables. Number of row fields
See: http://awesomescreenshot.com/0b21tice5d

Regards

Problem ok

[php]

<?php $result = $mysqlibag->query("SHOW TABLE STATUS"); while($table = $result->fetch_array()) { echo "Table name:".$table['Name']." Rows:".$table['Rows']."Size:".$table['Data_length']."
"; } ?>

[/php]

Thanks

Sponsor our Newsletter | Privacy Policy | Terms of Service