Page 1 of 1

Latest Images

Posted: Tue Feb 25, 2003 6:00 pm
by Simon18711
Ok well i dont know if there is a script for this or not but i'll try explain the sort of thing i want! :) BASICLY my image will be recorded into a MYSQL databases, with id's etc and what i want to do is show the latest pictures that have been uploaded (as images) on my main page?! If u see what i mean?! so i have the id, what directory its on etc on the database! is there any code that can do that?!

Thanks in advance

:D

Posted: Tue Feb 25, 2003 8:02 pm
by volka
if id is an auto-increment field the latest entry should be the one with the highest id.
try something like

Code: Select all

SELECT ...,id from tablename ORDER BY id DESC LIMIT 1
as query string

http://www.mysql.com/doc/en/Sorting_rows.html
http://www.mysql.com/doc/en/example-Maximum-row.html
http://www.mysql.com/doc/en/SELECT.html

Posted: Wed Feb 26, 2003 10:45 am
by hurkle
here's the best source on storing and retrieving images, and whatever else, in a database, that I've found.

http://www.devshed.com/Server_Side/PHP ... age1.html
Take a gander, hope it helps.