php中调用mysql数据库,怎么嵌套查询。
<?php$dosql->Execute("SELECT*FROM`#@__indexinfo`whereB_name='了解我们'");while($row=$dosq...
<?php
$dosql->Execute("SELECT * FROM `#@__indexinfo` where B_name='了解我们'");
while($row = $dosql->GetArray())
{
?>
<ul>
<li style="WIDTH: 250px; background:#ffff00;"><img src="<?php echo $row['picurl']; ?>" border=0 /></li>
<li style="WIDTH: 700px; background:#ff00ff;">
<div style="WIDTH: 700px; MARGIN:0; padding:0;">
<UL style="MARGIN:0; padding:0;">
<?php
$S_S = $row['S_S'];
$dosql->Execute("select * from `#@__indexinfo` where B_name='了解我们' AND S_S=$S_S AND checkinfo=true ORDER BY orderid DESC,id DESC");
while($row2 = $dosql->GetArray()){
?>
<LI style="width:100px; height:30px; float:left;"><?php echo $row2['S_name']; ?></LI>
<?
}
?>
</UL>
</div>
</li>
</ul>
<?
}
?>
循环一次就跳出了,怎么让能循环输出所有符合条件的内容。 展开
$dosql->Execute("SELECT * FROM `#@__indexinfo` where B_name='了解我们'");
while($row = $dosql->GetArray())
{
?>
<ul>
<li style="WIDTH: 250px; background:#ffff00;"><img src="<?php echo $row['picurl']; ?>" border=0 /></li>
<li style="WIDTH: 700px; background:#ff00ff;">
<div style="WIDTH: 700px; MARGIN:0; padding:0;">
<UL style="MARGIN:0; padding:0;">
<?php
$S_S = $row['S_S'];
$dosql->Execute("select * from `#@__indexinfo` where B_name='了解我们' AND S_S=$S_S AND checkinfo=true ORDER BY orderid DESC,id DESC");
while($row2 = $dosql->GetArray()){
?>
<LI style="width:100px; height:30px; float:left;"><?php echo $row2['S_name']; ?></LI>
<?
}
?>
</UL>
</div>
</li>
</ul>
<?
}
?>
循环一次就跳出了,怎么让能循环输出所有符合条件的内容。 展开
6个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |