Ok, here's the deal. I'm working on a real estate site. Each listing can have several pictures... or, rarely, NO picture.
My current code:
PHP Code:
$result=mysql_query("SELECT listings.listing_id, listings.type, listings.tag, listings.beds, listings.baths, FORMAT(listings.price,0), listings.sqft, images.filename FROM listings LEFT JOIN images ON listings.listing_id=images.listing_id WHERE type=$type ORDER BY $sort");
lists *all* the images, making several entries per listing. How do I make it only show *one* per listing_id, but show *all* listings, still?