missfine Posted May 19, 2009 Share Posted May 19, 2009 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 ??? Quote Link to comment Share on other sites More sharing options...
papaface Posted May 19, 2009 Share Posted May 19, 2009 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? Quote Link to comment Share on other sites More sharing options...
missfine Posted May 19, 2009 Author Share Posted May 19, 2009 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.