In article <9bng4u$ftc$[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] ("James, Yz") wrote:

> $sql = "SELECT * FROM table WHERE category LIKE 'Public House / Restaurant'
> OR description LIKE 'Public House / Restaurant'";
> 
> Surely that would bring the same row back twice....

Surely not.  Have you tried it yet?  Unless there are duplicate rows in the 
table (which should *not* be the case), each row that is matched by that 
query should only be returned once per execution of the query.

>  Is there any way of
> selecting from the table just once, without having to restrict the search
> facility to something like:
> 
> "SELECT * FROM table WHERE category LIKE '%$searchtext%'";
> 
> as opposed to having the "OR" in as well?

I'm not sure what you're after.  If executing the top example is getting 
you unwanted rows, perhaps you could re-post with some sample data and 
pointing out which rows are being shown in duplicate.  (It might also be a 
good idea to re-check your data first if there's any possibility that there 
are duplicate rows existing in the db.  'Cuz that's the kind of thing 
that's gonna mis-lead you about how SQL queries normally work.)

-- 
CC

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to