04-02-2009, 07:44 PM
|
#2 (permalink)
|
|
The Contributor
Join Date: Mar 2009
Location: Springfield, IL USA
Posts: 75
Thanks: 3
|
I always use count Vs using num_rows. My site uses a lot of queries, and the load on the server is fairly light given the size of my site.
Using an asterisk (*) wildcards count() to consider all fields. It does add a very small (not even noticeable) lag in the query process. However, if you only need to get count totals from a specific field, you can use just that field_name and it serves the same purpose.
I guess it all comes down to personal preferences. Some programmers like to code it one way, and others another way.
|
|
|
|