al3x8730 Posted September 21, 2008 Share Posted September 21, 2008 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.. Quote Link to comment https://forums.phpfreaks.com/topic/125219-counting-something/ Share on other sites More sharing options...
.josh Posted September 21, 2008 Share Posted September 21, 2008 save the number in your database or a flatfile. Each time someone searches the db, update the number in that field or file. Quote Link to comment https://forums.phpfreaks.com/topic/125219-counting-something/#findComment-647246 Share on other sites More sharing options...
al3x8730 Posted September 21, 2008 Author Share Posted September 21, 2008 save the number in your database or a flatfile. Each time someone searches the db, update the number in that field or file. What's a flatfile?... Quote Link to comment https://forums.phpfreaks.com/topic/125219-counting-something/#findComment-647248 Share on other sites More sharing options...
genericnumber1 Posted September 21, 2008 Share Posted September 21, 2008 just a phrase meaning storage as plain text in a file. Quote Link to comment https://forums.phpfreaks.com/topic/125219-counting-something/#findComment-647255 Share on other sites More sharing options...
al3x8730 Posted September 21, 2008 Author Share Posted September 21, 2008 just a phrase meaning storage as plain text in a file. How would I make something progressively add 1 to something inside another file? I know I could write a certain variable to a file, but then there's that problem again... So how do I do this? Quote Link to comment https://forums.phpfreaks.com/topic/125219-counting-something/#findComment-647256 Share on other sites More sharing options...
.josh Posted September 21, 2008 Share Posted September 21, 2008 google page hit counters it's the same principle Quote Link to comment https://forums.phpfreaks.com/topic/125219-counting-something/#findComment-647260 Share on other sites More sharing options...
al3x8730 Posted September 21, 2008 Author Share Posted September 21, 2008 google page hit counters it's the same principle I don't want to use that... How can I use flatfiles to do this? Quote Link to comment https://forums.phpfreaks.com/topic/125219-counting-something/#findComment-647262 Share on other sites More sharing options...
.josh Posted September 21, 2008 Share Posted September 21, 2008 google page hit counters it's the same principle Quote Link to comment https://forums.phpfreaks.com/topic/125219-counting-something/#findComment-647268 Share on other sites More sharing options...
al3x8730 Posted September 21, 2008 Author Share Posted September 21, 2008 google page hit counters it's the same principle ... I don't want to use that.... Quote Link to comment https://forums.phpfreaks.com/topic/125219-counting-something/#findComment-647279 Share on other sites More sharing options...
.josh Posted September 21, 2008 Share Posted September 21, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/125219-counting-something/#findComment-647282 Share on other sites More sharing options...
al3x8730 Posted September 21, 2008 Author Share Posted September 21, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/125219-counting-something/#findComment-647291 Share on other sites More sharing options...
AndyB Posted September 22, 2008 Share Posted September 22, 2008 Within the search thing I thought about adding a ++ to a variable. But that wouldn't save each time. How many times would you like to be told to use a simple 'hit counter'? Is there some reason you can't add that to your 'search thing'? Quote Link to comment https://forums.phpfreaks.com/topic/125219-counting-something/#findComment-647368 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.