php里面怎么循环嵌入html元素
<li data-role="collapsible">
<h1>中奖信息</h1>
<ul>
<?php
$sql = "select * from t_activity where MemberID='$memberID'";
$res = $db->GetData($sql);
while ($res)
{
<li>1</li>
}
$obj = mysqli_fetch_object($res);
?>
</ul>
</li>
如上面,从数据库取出数据来后,怎么从数据库结果集中循环输出想要的数据在html的li里面?
------解决方案--------------------<li data-role="collapsible">
<h1>中奖信息</h1>
<ul>
<?php
$sql = "select * from t_activity where MemberID='$memberID'";
$res = $db->GetData($sql);
while ($obj = mysqli_fetch_object($res))
{
?>
<li><?php echo $obj->字段 ;?></li>
<?php
}
?>
</ul>
</li>