Hi Guys,

Is there a method of extracting rows from a MySQL table Uniquely (as in only
once) ?..... For example, when a user performs a search, using two words,
it may return the same row twice if the search is spread over two or more
SQL "selections".  An example:

If hypothetical row 129 is a Public House, but the public house doubles up
as a restaurant, a search like this might return the same result twice.
Here is our hypothetical pub:

id = 129
name = The Blue Bell Inn
category = Public House
description = The Blue Bell Inn is a hypothetical pub, in the heart of rural
England.  Why not visit, have a drink and perhaps even dine in our fine
Restaurant area.

The user might perform the search, searching by "category" OR by
"description".  So if they typed "Public House / Restaurant" as the query,
the following would occur:

$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.....  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?

Thanks, as always,

James.



-- 
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