Jump to content

Change the order of uploaded images


missfine

Recommended Posts

He guys,

 

I have set up a database where I can upload images to my server in the folder '/uploads'.

An image is supposed to show up on "view.php page as a preview that when clicked will lead to a page with all of the uploaded images on it.

For some reason when I upload images a random one shows up on the page 'view.php' in no particular order.

I am new at this and wondering how I can make the images sort by 'first uploaded or last uploaded'

<img src="http://website.com/login/uploads/<?=$photo->filename?>" is my code for my view.php page (preview image)

 

I think this is where the filename is created

// create filename

$filename = time().'.jpg';

$path = $path.$filename;

 

Once uploaded, the filename is usually just a whole bunch of numbers...

 

Please email me if you need any more info...I really appreciate any help you can give me  ??? :)

 

 

Link to comment
https://forums.phpfreaks.com/topic/158795-change-the-order-of-uploaded-images/
Share on other sites

Your file names are that of the time the image was created. When the image is created is the location stored in a database? Do you have the mysql_query() which is used to extract that info from the db?

 

Yeah, it is stored in a database. I can't seem to find the query used. What can I do with it if I do find it? What can I replace this with to allow it to sort by first or last uploaded?

 

:)Thanks :)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.