PHP数组怎么镶嵌循环
程序员文章站
2022-06-14 10:12:02
...
PHP数组如何镶嵌循环?
$dosql->Execute("SELECT * FROM `#@__infoclass` WHERE parentid=5 AND checkinfo=true ORDER BY orderid ASC");
while($row = $dosql->GetArray())
{
?>
$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())
{
?>
}
?>
如何循环内在写一个循环
}
?>
------解决方案--------------------
再实例化一个数据库类
$dosql->Execute("SELECT * FROM `#@__infoclass` WHERE parentid=5 AND checkinfo=true ORDER BY orderid ASC");
while($row = $dosql->GetArray())
{
?>
$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())
{
?>
}
?>
如何循环内在写一个循环
}
?>
------解决方案--------------------
再实例化一个数据库类
相关文章
相关视频
上一篇: php页面转换成pdf 再以邮件形式发出去解决办法
下一篇: PHP处理文件