2012-09-29, 07:41 AM
I would like to show a value taken from the database on the header, on the middle of my links menu. I have the sql the returns a number, and I would like it to be cached and updated at every minute. Every time a users calls a page a function would check if the time last fetch is higher than 60, if it is, it would query the db again, if not, it would return the cached value.
I know I can use some PHP on templates (where my links are) using conditional templates plugin to access a global class from a template, would I be able to share this cached value among all viewing users?
any (hello word) example showing how to access the db from the template would be very welcome..
I know I can use some PHP on templates (where my links are) using conditional templates plugin to access a global class from a template, would I be able to share this cached value among all viewing users?
any (hello word) example showing how to access the db from the template would be very welcome..