troubleshooting Question

How to show images from a relational database table

Avatar of BrighteyesDesign
BrighteyesDesignFlag for Afghanistan asked on
9 Comments1 Solution397 ViewsLast Modified:
As part of a property site I had all info held in one table called 'properties'. However I have just changed the  make up.

Before there were 10 columns in the properties table: image1, image2 etc...I thought having a specific table for images was the way to go so the image filenames are now in a separate relational table called 'images'

I'm not sure though how to display the images. Before, for the thumbnail results page I would use...

SELECT propertyID, pricePrefix, additionalimage1, country_code, image1, name, FORMAT(prices,2) as prices, `currency` FROM properties WHERE cityCode = '456' ORDER by RAND ()"

How do I make this query display an image/filename from the images table if the 'propertyid' value matches the 'PropertyID' from the 'properties' table
Join our community to see this answer!
Unlock 1 Answer and 9 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 9 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros