php在html中写循环,如何在这个php循环中集成这个html?

编程入门 行业动态 更新时间:2024-10-07 18:23:27

php在html中写循环,如何<a href=https://www.elefans.com/category/jswz/34/1754661.html style=在这个php循环中集成这个html?"/>

php在html中写循环,如何在这个php循环中集成这个html?

我有这个PHP代码,我试图与下面的HTML布局集成,但我无法弄清楚,PHP

代码获取所有状态发布并按顺序显示它们,但它会显示与状态发布关联的所有注释,以便状态发布可能具有

0评论或它可能有多个评论。

如果您阅读我在PHP代码中留下的注释以及我在html中留下的注释,您将看到我面临的问题

我需要以某种方式将注释放在状态发布的表格单元格中

在下面的图片中,有1个状态帖子和3个关于该帖子的评论,我想要做的是让评论显示在自己的表格中,该表格将嵌套在状态帖子右侧的右侧。因此,在顶部的状态帖子中,您会在该帖子的底部看到一个表格边框,该边框应该低于该帖子的最后评论,希望现在更有意义

alt text .jpg

$last_id = 0;

echo '

while ($row = mysql_fetch_array($res)) {

//start output of new status post and comments

if ($row['0'] != $last_id) {

echo 'status post stuff'

}

//start output of new status post and comments

//output comment here

$last_id = $row['0'];

if($row['commentid'] != ''){

echo 'status COMMENT for above status post'

}

//END output comment here

}

echo '

';

?>

so and so said blah blah blah @ wee hours of the moring!
Date Posted
Comment text

更多推荐

php在html中写循环,如何在这个php循环中集成这个html?

本文发布于:2024-02-19 16:19:43,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1765132.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:在这个   php   html

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!