04-02-2009, 07:55 PM
|
#3 (permalink)
|
|
Wizard
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
|
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.
|
|
|
|