anthonydamasco Posted September 7, 2006 Share Posted September 7, 2006 Really simpleI have 2 columns in a table that I want people to be able to search fromhere is my php[code=php:0]$result = mysql_query("SELECT * FROM employees WHERE firstname or lastname LIKE '%$search%'");[/code]i know "or" is wrong, because its only searching the "lastname" column, what is the correct santax? Link to comment https://forums.phpfreaks.com/topic/20016-php-mysql-easy-quick-santax-question/ Share on other sites More sharing options...
ober Posted September 7, 2006 Share Posted September 7, 2006 $result = mysql_query("SELECT * FROM employees WHERE firstname LIKE '%$search%' OR lastname LIKE '%$search%'");OR is correct. Link to comment https://forums.phpfreaks.com/topic/20016-php-mysql-easy-quick-santax-question/#findComment-87775 Share on other sites More sharing options...
anthonydamasco Posted September 7, 2006 Author Share Posted September 7, 2006 well the way i used it wasnt, lol, thank you Link to comment https://forums.phpfreaks.com/topic/20016-php-mysql-easy-quick-santax-question/#findComment-87776 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.