On Wed, Feb 27, 2008 at 6:44 PM, Nasreen Laghari
>  I am creating a SEARCH, by only using one table. The search form  is same as 
> Inserting item (search has form of all fields in table ), difference is 
> SEARCH page doesnt have validation . Therefore user can enter information in 
> any of field. I would like to know how to write a SELECT query which has 
> multiple where clause with OR operator.

    SELECT * FROM tableName WHERE (colA LIKE '%value%' OR colB='1');

        --- more ---

    SELECT fieldA,fieldR,fieldT,fieldX FROM tableName WHERE
(colA='value' OR colB LIKE 'Hello%') AND colC='Active';


Daniel P. Brown
Senior Unix Geek
<? while(1) { $me = $mind--; sleep(86400); } ?>

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to