JonnySnip3r Posted June 30, 2010 Share Posted June 30, 2010 Hey guys n gals hope someone can help me with this, anyways i managed (through the help of phpmyadmin) to construct a working search query here it is. SELECT * FROM users WHERE username LIKE '%$search_user%' ok the thing is how would i get it to search more than one table? i have tried several ways and cant seem to get it to work i would like it not just to search username but firstname and lastname aswell. Thanks Link to comment https://forums.phpfreaks.com/topic/206299-php-mysql-search-string-help-please-d/ Share on other sites More sharing options...
premiso Posted June 30, 2010 Share Posted June 30, 2010 You mean more than one column: SELECT * FROM users WHERE (username LIKE '%$search_user%' OR firstname LIKE '%$search_user%' OR lastname LIKE '%$search_user%') Should be what you are after. Link to comment https://forums.phpfreaks.com/topic/206299-php-mysql-search-string-help-please-d/#findComment-1079298 Share on other sites More sharing options...
JonnySnip3r Posted June 30, 2010 Author Share Posted June 30, 2010 Yeah column haha thank you very much dude helped allot i tried something similar but i forgot the brackets haha thank you again!! Link to comment https://forums.phpfreaks.com/topic/206299-php-mysql-search-string-help-please-d/#findComment-1079312 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.