开发者

MySQL MATCH AGAINST and $wpdb->prepare()

开发者 https://www.devze.com 2023-03-01 22:48 出处:网络
Can they work together? I cant find o开发者_Python百科ne example anywhere.I have tested it with:

Can they work together? I cant find o开发者_Python百科ne example anywhere.


I have tested it with:

$sql = $wpdb->prepare('SELECT * FROM wp_posts 
                       WHERE MATCH(post_content) AGAINST ("test")');
$results = $wpdb->get_results($sql);

And it works fine. But of course, I had to create a FULLTEXT index on the post_content field first, as Wordpress doesn't include this type of index (v3.1).

0

精彩评论

暂无评论...
验证码 换一张
取 消