Basically I want to enable people to search both the listing table and the custom fields table.
Here is my code:
Code: Select all
$listings_query = mysql_query("SELECT * FROM listings_items AS l JOIN listings_customfields AS c ON l.id = c.listingid WHERE
l.title rlike '".make_safe($search_keywords)."' or
l.code rlike '".make_safe($search_keywords)."' or
l.summary rlike '".make_safe($search_keywords)."' or
l.description rlike '".make_safe($search_keywords)."' or
c.value rlike '".make_safe($search_keywords)."'
GROUP BY l.id") or die(mysql_error());Any idea on how I can make it still show results if nothing exists in the listings_customfields table?