Left Join 3 Tables and Show True or False on Empty Cells
Posted
by Jason Shultz
on Stack Overflow
See other posts from Stack Overflow
or by Jason Shultz
Published on 2010-03-18T02:02:15Z
Indexed on
2010/03/18
3:21 UTC
Read the original article
Hit count: 372
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.
© Stack Overflow or respective owner