Entry
How do i display the number of records on my main page without constantly quering mySQL? (eg. displaying the number of job postings are in mydatabase)
Jun 17th, 2000 06:48
Antonio Galea, Mark Andrews, Onno Benschop,
Since the number is going to change only with INSERT or DELETE
operations, you need to obtain the record count (with a query like
'SELECT COUNT(*) from _my_table_here_') from your table only after such
an event; when you do, save it into a file and read that file from your
home page (remember to lock file before writing!).
The count will be accurate only as long as you catch _all_ the
insert/delete operations on the table, though...