<header class="page-header"><h3 class="archive-title">网友最新提问</h3></header><?php $result = $wpd...">

加入测心网,获得更多

如果您有心理学背景,欢迎加入测心网,服务网友,获得打赏。如有意愿,请联系微信:57762787

wordpress下sql调用同一数据库任意数据表内容并呈现

<div class="lianglanwenxin">
<header class="page-header"><h3 class="archive-title">网友最新提问</h3></header>
<?php
$result = $wpdb->get_results("SELECT question_id,question_content FROM aws_question ORDER BY question_id desc LIMIT 0 , 10");
foreach ($result as $topten) {
$question_id = $topten->question_id;
$question_content = $topten->question_content;
if ($question_id != 0) {
?>
<li><a href="https://qiexuxing.com/ask/?/question/<?php echo $question_id ?>" title="<?php echo $question_content ?>"><?php echo $question_content ?></a></li>
<?php } } ?>
</div>

上述代码已经可以实现调用后列表显示

打赏作者,期待美好

打赏鼓励作者,为网友提供更多更好的测试。如未发现想要的测试,请联系微信:57762787

如有帮助,欢迎打赏!

微信扫一扫打赏