Hi.
I want to make a search query that have two tables in which it finds out if the search string exists in one of three fields in one of the tables.
This works fine because only one of the fields are checked:
$sql = $db->query("SELECT p.*,pd.name,pd.short_description,pd.description,pd.price,pd.vat FROM products AS p, products_description AS pd WHERE p.id=pd.product_id AND pd.country_id='$country_id' AND pd.name LIKE '$search'");
This one screws up, when I want to check three fields in all:
$sql = $db->query("SELECT p.*,pd.name,pd.short_description,pd.description,pd.price,pd.vat FROM products AS p, products_description AS pd WHERE p.id=pd.product_id AND pd.country_id='$country_id' AND pd.name LIKE '$search' || pd.short_description LIKE '$search' || pd.description LIKE '$search'");
Do you know what is going on?