View Single Post
Old 02-14-2008, 12:55 AM   #8 (permalink)
Alan @ CIT
Member of the Month
The Frequenter
Member of the Month Top Contributor 
 
Alan @ CIT's Avatar
 
Join Date: Apr 2005
Location: South UK
Posts: 483
Thanks: 51
Alan @ CIT is on a distinguished road
Default

I'm not entirely sure what you are trying to do, but in your original code, the reason it only increments it to 1 is because you are resetting the variable to 0 before you increment it.

I'm guessing that you want to do something like vBulletins thread views counter. The general idea is to get the number of views (ie, from a database), increment it by one, then store the new value back in the database.

If you wanted to update the page instantly, then use Ajax as Rendair suggested after you have read/write the values to the database.

Alan
Send a message via MSN to Alan @ CIT
Alan @ CIT is offline  
Reply With Quote