tefnut Posted June 7, 2007 Share Posted June 7, 2007 I'm a beginner for php so please bear with me. I have some code, this isn't all of it, I figured this is the bit I need to change : $query = "select * from companies where company like \"%$trimmed%\" order by company" I want it to search multiple column like 'tel' as well as 'company' I've tried: $query = "select * from companies where company, tel like \"%$trimmed%\" order by company" But doenst seem to work. Can anyone tell me what to change or should I post the rest of the code so someone can help? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/54607-search-multiple-column-query/ Share on other sites More sharing options...
Psycho Posted June 7, 2007 Share Posted June 7, 2007 SELECT * FROM companies WHERE company like \"%$trimmed%\" OR tel like \"%$trimmed%\" ORDER BY company Quote Link to comment https://forums.phpfreaks.com/topic/54607-search-multiple-column-query/#findComment-270076 Share on other sites More sharing options...
tefnut Posted June 7, 2007 Author Share Posted June 7, 2007 Cheers you a star, t'worked! xxxx Quote Link to comment https://forums.phpfreaks.com/topic/54607-search-multiple-column-query/#findComment-270087 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.