Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
Can anyone explain me the concept of implementing time ago like facebook
in php. I dont want code. I want to know the flow like database field type, whether to use UTC time stamp and to convert to local time.
Thanks
It is all about your users location. If you have users only at a single timezone, then no need of conversion. But if your users are at different time zones, then you require a conversion.
In the second scenario, covert and save time in DB as UTC, then according to each user location, convert time during fetch.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I am working on a school project. The assignment is to recreate our own version of Ebay. A requirement is to display the number of logged in users. What is the best way to do this? We are using PHP.
We are using a database so we could save the amount of loggins there but there is no proper way to decrease this amount since people often just leave the site without logging out.
Some suggestions would be awesome!
you could have a heartbeat script that updates a datetime on the user column.
and the show logged in users script could get all logged in users with time < 5 mins
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
My project is online voting system in php, requirements is that one user votes, So he will be able to vote only then after 4 years.
Sessions gonna work ?
No. Sessions only last as long as the browser remains open.
A better idea would be to post the data to a database with a timestamp. Then, when the user tries to vote again, the most recent vote timestamp by that user is drawn from the database.
If the most recent vote timestamp is > 4 years old, you can then allow the user to post again.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I am having this project to update the data everyday and I just want it to update like realtime date everyday without opening the website like trigger or some timer in my database.
For example there like points system for bronze account there would be 1 points everyday how can I do that in php mysql thank you for the help
ill just find out the answer to my problem ill just use the MYSQL Event to update the points every day and let the date update everyday .
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I' building up a browsergame. I was wondering what is the best way to build up the "money" system. i no need anything "fast". I mean, the cash cuold be updated every day \ week. Is that possible doing it automatically? Like at 00.00 of every sunday it update automatically? Of course i need to update it every time someone buy something so it shuold be auto incrementing but still modificable with php query system!
Thanks a lot!
table wallets: id, user_id, amount
UPDATE wallets SET amount = amount+10
So you can call this query every week and it will increment all wallets by 10.
http://sqlfiddle.com/#!9/99dfe/1
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
i want to know how much time a visitor stays on my website..??? can it be done with any online services ??..Any help would be appreciated..
Use Google analytics http://www.google.com.au/analytics/
A session can only change every time you call set or reset it.
But if you wanted to, you could use jQuery ajax, to run a script every X seconds or mins. Then in the file that you are ajax'ing in. Change your session data.
You will find analytics make a new request every time the user does something. Like moves the mouse, clicks on something, etc. So you would have to set up some js to do that as well.