Im trying to make an sql function that displays the highest value however all the variations of the MAX function i use, still turn up with an empty image. What’s going on here? how do i fix this?
//displays no image and doesn’t give any errors
$result = mysql_query("SELECT MAX(id) AS id FROM people") or die (mysql_error());
//displays image 87
$result = mysql_query("SELECT * FROM people WHERE id = 87") or die (mysql_error());

It shouldn’t display an image, it should give a result of 87.
See MAX
You could do:
which should give you the latest image by ID.
To make this dynamic and allow a next button you would need to store the value of image being viewed. When the next button is clicked you could then do
See MySQL Limit
You would need to use PHP to assign the values in limit and your next link though. To do this you would need to have link like so:
Then using PHP you could:
TO expand on the link, you could then make your link dynamic: