So I’m trying to create a system where the user can go to a page where a photo is displayed. The photos have a column in the MySQL db for views. How would I be able to view the top viewed photo with a link on the page for the photo with the 2nd most viewed photo, which has a link for the 3rd most viewed photo, etc. Each photo would have a dedicated page.
I’m using CakePHP, if there are any CakePHP specific strategies for doing this. Any suggestions?
I have never had the experience of using cakePHP, but with PHP and MySQL, you can use a query like this:
and then, using a GET variable to pass on the incremental/decremental value of
$i.