php 两个while循环 如何 第一个循环执行完第二个循环单独执行
<?php$query="SELECTcarnameFROMcarnamewherezimu='A'";$result=mysql_query($query)ordie(...
<?php
$query = "SELECT carname FROM carname where zimu = 'A' ";
$result = mysql_query($query) or die("ERROR003");
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)){ ?>
<?php foreach($line as $car){?>
<li>
<?php $query1 = "SELECT url FROM url where ban = 'B' ";
$result1 = mysql_query($query1) or die("ERROR003");?>
<?php while ($line1 = mysql_fetch_array($result1, MYSQL_ASSOC)){ ?>
<?php foreach ($line1 as $a){ ?>
<i><img src="<?php echo $a; ?>" alt=""></i>
<?php } ?>
<?php } ?>
<a href="xinghao.php?n=<?php echo $car; ?>"><?php echo $car; ?></a>
</li>
<?php } ?>
<?php } ?> 展开
$query = "SELECT carname FROM carname where zimu = 'A' ";
$result = mysql_query($query) or die("ERROR003");
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)){ ?>
<?php foreach($line as $car){?>
<li>
<?php $query1 = "SELECT url FROM url where ban = 'B' ";
$result1 = mysql_query($query1) or die("ERROR003");?>
<?php while ($line1 = mysql_fetch_array($result1, MYSQL_ASSOC)){ ?>
<?php foreach ($line1 as $a){ ?>
<i><img src="<?php echo $a; ?>" alt=""></i>
<?php } ?>
<?php } ?>
<a href="xinghao.php?n=<?php echo $car; ?>"><?php echo $car; ?></a>
</li>
<?php } ?>
<?php } ?> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询