query problem

From: Date: Thu, 02 Oct 2003 18:31:27 +0000
Subject: query problem
Groups: php.db 
Request: Send a blank email to php-db+get-30808@lists.php.net to get a copy of this message
I'm having a problem with a specific query. SELECT DISTINCT(contents_.company_id), companies.* FROM contents_, companies WHERE contents_.Products LIKE '%heating%' OR contents_.Manufacturer LIKE '%heating%' AND contents_.company_id = companies.id The query works fine without the "OR" segment, for example: SELECT DISTINCT(contents_.company_id), companies.* FROM contents_, companies WHERE contents_.Products LIKE '%heating%' AND contents_.company_id = companies.id works fine. But I need the query to search 2 columns, and it's returnng a vast number of records when I do the first search. Any help would be greatly appreciated. ------------------------------------------------------------ http://www.phreshdesign.com

« previous php.db (#30808) next »