How to Efficiently Count Records of an SQL Table with PHP
Last Updated on Friday, 4 January 2013 12:00 Written by Richi González Friday, 4 January 2013 12:00
Hello,
For the last website I made, I created a really flexible and friendly administration panel where there were a lot of statistics to analyze how the website was performing. I came across different ways of counting records in a table, yet stuck with this one, the most efficient:
The query is really simple, we will use SELECT COUNT(1), then mysql_fetch_row() that count. The code would look like this:
Learn More
Tags: count, count(1), database, efficient, fastest, how to, optimize, php, records, select count, sql, table, way | Posted under Programming/Coding | No Comments

Recent Comments