Jump to content

Counting something...


al3x8730

Recommended Posts

I want to record the number of times something has been done, in this case how many a user has searched my database. Within the search thing I thought about adding a ++ to a variable. But that wouldn't save each time. How would I go about doing this so that everytime a user does something it adds 1 to a variable, but that variable saves so it doesn't reset to 0 each time..

Link to comment
https://forums.phpfreaks.com/topic/125219-counting-something/
Share on other sites

You want to have a number stored in a file, and you want to increment that number each time something happens right?  That's the same principle as a hit counter.  If you google hit counters, you will find plenty that use a flatfile that simply open a file, increment the value, and close it, the end. 

 

Or are you saying that you don't want to use google, you'd rather be spoonfed stuff?  Because that's not how it works around here.

Link to comment
https://forums.phpfreaks.com/topic/125219-counting-something/#findComment-647282
Share on other sites

You want to have a number stored in a file, and you want to increment that number each time something happens right?  That's the same principle as a hit counter.  If you google hit counters, you will find plenty that use a flatfile that simply open a file, increment the value, and close it, the end.   

 

Or are you saying that you don't want to use google, you'd rather be spoonfed stuff?  Because that's not how it works around here.

 

Haha. Sorry for the misunderstanding, I thought you ment to use "Google Hitcounter" And I don't want to use a hitcounter. Sorry about that.

Link to comment
https://forums.phpfreaks.com/topic/125219-counting-something/#findComment-647291
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.