Hello, I have recently started coding in php and I have bought books and searched a million times online and I cannot find out how to list objects according to the amount of times they have been viewed. Can someone help me out with a code here?
Edit: Amount of times viewed either total or daily. Preferably daily. I know how to show it for each individual user, but I want it to be listed as a whole (Everyone that has viewed my site for that entire day.)
Need Help Writing Script, For Listing By Views
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
A database is best suited to storing count information over a number of pages. Only in rare circumstances would it be better to use a file, due to race conditions that may occur.
A views today list will require two fields. The last time it was viewed and the count. When the day changes you will need to reset the count.
Start writing some code and post specific questions you may have.
A views today list will require two fields. The last time it was viewed and the count. When the day changes you will need to reset the count.
Start writing some code and post specific questions you may have.
As feyd said, a database count would be best.
Increment the count field by one on every page view. Then when you query for the information out of the database, order it by your count field.
Increment the count field by one on every page view. Then when you query for the information out of the database, order it by your count field.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.