View Single Post
Old 04-02-2009, 07:44 PM   #2 (permalink)
WebSavvy
The Contributor
 
WebSavvy's Avatar
 
Join Date: Mar 2009
Location: Springfield, IL USA
Posts: 75
Thanks: 3
WebSavvy is on a distinguished road
Default

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.
WebSavvy is offline  
Reply With Quote
The Following User Says Thank You to WebSavvy For This Useful Post:
allworknoplay (04-02-2009)