I’m building a large custom search for a wordpress site that is functioning as a directory. Part of the search is using SQL to poll for multiple meta values, and the other part is by title. I can’t seem get a simple SQL LIKE to work when polling the titles. Below is my code:
SELECT * FROM wp_posts WHERE post_type = 'business' AND post_status = 'publish' AND post_title LIKE 'Butler' ORDER BY post_title ASC
Use wildcards in your
LIKE: