I have a table using innodb. I know the table has roughly 89 million rows. Using
SELECT COUNT(*) FROM table;
takes about five minutes to run. I
If you are OK with the estimated number and just don't want to mess with running SHOW TABLE STATUS from PHP, you can use the information_schema DB:
SHOW TABLE STATUS
SELECT TABLE_ROWS FROM information_schema.tables WHERE TABLE_SCHEMA = 'my_db_name' AND TABLE_NAME = 'my_table_name';