Use it at the start of the page that you want to count.
Just make sure the database connection is already open.