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? 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. 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. 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. 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
Archived
This topic is now archived and is closed to further replies.