Latest Images

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Simon18711
Forum Newbie
Posts: 4
Joined: Fri Feb 21, 2003 7:27 pm

Latest Images

Post 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
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post 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
hurkle
Forum Newbie
Posts: 15
Joined: Tue Feb 11, 2003 1:21 pm
Location: Minnesota, USA

Post 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.
Post Reply