View Single Post
Old 04-02-2009, 07:55 PM   #3 (permalink)
Village Idiot
Wizard
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
Village Idiot is on a distinguished road
Default

When left between the choice of leaving the SQL server to process returned data and letting the script handle it, it is almost always a better idea to let the database do it. Using PHP to count the rows runs an unnecessary query which returns more rows than needed (the initial one), an another completely different one (num_rows runs another query to my understanding). Using the count function keeps it to one small consise query.
__________________

Village Idiot is offline  
Reply With Quote
The Following User Says Thank You to Village Idiot For This Useful Post:
allworknoplay (04-02-2009)