开发者

MySQL MATCH AGAINST and $wpdb->prepare()

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜