TecTao Posted December 16, 2012 Share Posted December 16, 2012 Is there a way to do a wildcard search for a word or phrase in all fields of a table such as select * from `aTable` where `(all fields)` like % this word or phrase% rather than elect * from `aTable` where `fields1` like % this word or phrase% OR `fields2` like % this word or phrase% OR `fields3` like % this word or phrase% Basically a search through the entire table for a specific word or phrase? Quote Link to comment https://forums.phpfreaks.com/topic/272071-is-there-a-way-to-search-an-entire-table-for-wildcard-word-or-phrase/ Share on other sites More sharing options...
Jessica Posted December 17, 2012 Share Posted December 17, 2012 No. Quote Link to comment https://forums.phpfreaks.com/topic/272071-is-there-a-way-to-search-an-entire-table-for-wildcard-word-or-phrase/#findComment-1399733 Share on other sites More sharing options...
PFMaBiSmAd Posted December 17, 2012 Share Posted December 17, 2012 I've seen people concatenate the columns together and use that on the left-hand side of a LIKE '%%' comparison. Quote Link to comment https://forums.phpfreaks.com/topic/272071-is-there-a-way-to-search-an-entire-table-for-wildcard-word-or-phrase/#findComment-1399734 Share on other sites More sharing options...
fenway Posted December 22, 2012 Share Posted December 22, 2012 Or you could use a proper full-text indexing product, like sphinx. Quote Link to comment https://forums.phpfreaks.com/topic/272071-is-there-a-way-to-search-an-entire-table-for-wildcard-word-or-phrase/#findComment-1400881 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.