Left Join 3 Tables and Show True or False on Empty Cells
- by Jason Shultz
Ok, this may be confusing so I hope I explain it correctly.
I have 4 tables:
business
photos
video
category
I want to display "featured" businesses on the home page (or elsewhere) and I want to show a Yes or No in the table row based upon whether or not there are photos or videos for that business.
Example: Joes Crab Shack has no videos or photos but is featured. So, when his row is echoed out it will show the Business Name and Business Owner but there will be no data in the photo or video cells thus in the video and photos column it will say No. Otherwise, if the opposite was true, it would say Yes.
Here's my pastebin