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
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 :)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.