mySQL database search exact phrase
what is the easiest way on a wordpress site to have a database of unique ID numbers and have a search field that searches the exact phrase and displays results开发者_高级运维?
create a table to have unique ids, and words
To search by a word
then use -> SELECT * FROM words_table WHERE word LIKE "%ed%";
This will return results where ed is in words such as end*ed*, start*ed*, startl*ed*, *ed*ucation
To search by an id
use -> SELECT * FROM words_table WHERE id = {$id}
精彩评论