Magento: Get a rough total for all rows in all tables in mysql
Tuesday, February 14th, 2012$query = “SELECT table_rows FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = ‘database_name_goes_here’”;
$result = Mage::getSingleton(‘core/resource’) ->getConnection(‘core_read’)->fetchAll($query);
$total = 0;
for( $i = 0; $i {
$total += $result[$i]['table_rows'];
}
echo ‘Grand Total = ‘ . $total;