PHP数组如何镶嵌循环?
<?php
$dosql->Execute("SELECT * FROM `#@__infoclass` WHERE parentid=5 AND checkinfo=true ORDER BY orderid ASC");
while($row = $dosql->GetArray())
{
?>
<li><a href="news.php?cid=<?php echo $row['id']; ?>"><?php echo $row['classname']; ?></a></li>
<?php
$dosql->Execute("SELECT * FROM `#@__infoimg` WHERE classid='".$row['id']."' AND flag ='c' AND checkinfo=true ORDER BY orderid DESC LIMIT 0,6");
while($srow = $dosql->GetArray())
{
?>
<li> <a href="<?php echo 'productshow.php?cid='.$srow['classid'].'&id='.$srow['id']; ?>"><span class="pinpai" ><?php echo ReStrLen($srow['title'],10);?></span></a></li>
<?php
}
?>
如何循环内在写一个循环
<?php
}
?>
------解决方案--------------------再实例化一个数据库类