SQL does not trigger an error, so you do not have data in your database that matches all of the criteria. As written, you'd need one or more of these:
(b.meta_key='firstname-groom' AND b.meta_value LIKE 'Darren')
OR (b.meta_key='firstname-bride' AND b.meta_value LIKE 'Someone')
OR (b.meta_key='lastname-bride' AND b.meta_value LIKE 'Cool')
AND (b.meta_key='weddingdate' AND b.meta_value='12/14/2014')
To match for this to return results. However, if you look carefully, that condition is never going to occur because it would require that
b.meta_key be both
weddingdate and one of
lastname-bride at the same time, which will never happen. You will need to
JOIN the tables multiple times once for the names and once for the date. (It looks like you worked that out already in a comment, so I won't write the
I would make another comment though.
- Saving a date like
12/14/2014 is a bad idea. There is very little
rational sorting you can do with that date format and extracting
month, day, or year data is not going to be especially efficient or
reliable as none of
MySQL's date functions will work.
I would suggest a user query but looking at your
SQL I think the logic is too complicated for that class.