I wat to use existing wordpress database with my own custom php script but got problem with search result.
How to search using phpmyadmin sql with wordpress search query?
I wat to use existing wordpress database with my own custom php script but
Share
Found it using var_dump(get_defined_vars()) in search.php file
for search keyword I love to learn php the sql is
SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND (((wp_posts.post_title LIKE ‘%i%’) OR (wp_posts.post_content LIKE ‘%i%’)) AND ((wp_posts.post_title LIKE ‘%love%’) OR (wp_posts.post_content LIKE ‘%love%’)) AND ((wp_posts.post_title LIKE ‘%to%’) OR (wp_posts.post_content LIKE ‘%to%’)) AND ((wp_posts.post_title LIKE ‘%learn%’) OR (wp_posts.post_content LIKE ‘%learn%’)) AND ((wp_posts.post_title LIKE ‘%php%’) OR (wp_posts.post_content LIKE ‘%php%’))) AND wp_posts.post_type IN (‘post’, ‘page’, ‘attachment’) AND (wp_posts.post_status = ‘publish’ OR wp_posts.post_author = 1 AND wp_posts.post_status = ‘private’) ORDER BY wp_posts.post_date DESC LIMIT 0, 10