Jump to content

[SOLVED] Another way (mysql_num_rows())


phat_hip_prog

Recommended Posts

Hi,

I'm wanting to count the number of rows in a table but without having to execute a query first... i.e. to cut down on data transfered...

At the moment it's lucky that the table in question has an 'id' field which is small, but when there's thousands of entries, this will still be large.

 

 

Sorry this does it:

$s = "SELECT COUNT(*) as num FROM ".$tn."";

 

 

Link to comment
https://forums.phpfreaks.com/topic/60966-solved-another-way-mysql_num_rows/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.