PDA

View Full Version : Overall Database Record Count


stickamw
2-12-06, 01:33 AM
Hi All! I am still very new at mySQL & PHP but trying! I have scoured the forum, 'net and manuals with no solution. So here goes!

Is there a clean/easy way to get the overall record count for an entire database? My db currently has 27 tables (with many more probably coming up) and I want to be able to get a single count of the total number of table rows for all tables. I have tried the SELECT COUNT(*) function a number of different ways without luck. And, in looking around, the focus seems to be getting the number of rows for a given table...mysqlshow table status, etc.

To get an idea of what I am trying to do, take a look at a database structure in phpMyAdmin...at the bottom of the Records column is a total number of records in the db. I imagine this is probably some type of summation but as I am still green, I don't know of the best way to do this.

Many thanks in advance for any help on this one. :wreck:

Pig
2-13-06, 10:01 PM
AFAIK, there is no command to do that. It could be done fairly easily with a PHP script. the show tables command would return the tables. From there, you could loop through each table to get the number of rows.