Grabbing Random Images From Database

I have two separate databases for images. users can upload images and they will show up on the images.php page. I want to grab images from images1 and images2 databases and display them on the images.php page.

How can I do this and make sure that images of the same filename don’t display on the images.php page? Thanks

Below is what the two databases are like. I want to grab from images from images1 and Images2 and display them next to each other because Im going to turn this page into a poll. were members can vote on the better image.

Images1

user image


Images2

user2 user2image

where do you specifically need help with?

displaying the image on the browser OR Retrieving data from Database or something similar?

Are you sure you mean two different databases and not two different database tables? I would highly recommend using a single database if you have a choice; if not you will have to establish and close mysql connections in your script each time that you want to access data from one or the other db - which is a real mess from both a performance and a coding perspective. Also, you say that you are storing the images in the database - are you storing the binary image data, or are you storing the path(s) to the image files? Again, storing actual binary image data in your database is just terrible for performance.

Sponsor our Newsletter | Privacy Policy | Terms of Service