searching multiple fields

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Is there a way to use like to search various fields at one time.

For example I want the search field to search by name or area or 
organisation. If the (minimum)three letter string matches any of these I 
want the record to show. $search_field is my textbox

$query = "SELECT * FROM sheet1 WHERE 'name' LIKE '$search_field%'";


but really I want it to do the folowing.


$query = "SELECT * FROM sheet1 WHERE 'name' or 'area or 'organisation LIKE 
'$search_field%'";

Cheers,

R. 

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux