您好,这是我的查询。我想要显示的帖子的标题满足以下但t不显示任何内容,我不知道。谢谢! 另外,有没有另一种方式来显示结果,更像wordpress?显示我的查询结果时出现的问题
<?php
$theposts = $wpdb->get_results("SELECT post_title FROM $wpdb->posts
WHERE ID IN
(
SELECT DISTINCT post_id
FROM $wpdb->postmeta
WHERE meta_key = 'extra1' AND meta_value = 'test'
)");
foreach ($theposts as $thepost) {
echo $thepost->post_title;
}
?>
你为什么不显示错误? – alex 2011-05-01 01:49:05
它不显示任何内容。我的metakey和metavalue是正确的。 – EnexoOnoma 2011-05-01 01:53:09