Heim > Artikel > Backend-Entwicklung > 循环转晕了解决方法
循环转晕了
$sql="select * from href where id=$id order by link ";
$query=mysql_query($sql);
while($array=mysql_fetch_array($query)){
?>
<?php $sql="select * from href where id=$id order by link "; $query=mysql_query($sql); if($id!==1 and $id!==2){ while($array=mysql_fetch_array($query)) { ?> <td height="30"> <img style="max-width:90%" src="list.files/biao_33.gif" style="max-width:90%" align="absMiddle" alt=" 循环转晕了解决方法 " > <a href="list.php?id=<?php%20echo%20%24id;?>"> <?php echo $array["link"]; ?> </a> </td> <?php } //对应while } //对应if else if($id==1){ // 2 ?> <td height="30"> <img style="max-width:90%" src="list.files/biao_33.gif" style="max-width:90%" align="absMiddle" alt=" 循环转晕了解决方法 " > <a href="content.php?id=<?php%20echo%20%24id;?>"> <?php echo $array["link"]; ?> </a> </td> <?php } // 对应上面的else if($id==1) // 2 else if($id==2){ // 3 ?> <td height="30"> <img style="max-width:90%" src="list.files/biao_33.gif" style="max-width:90%" align="absMiddle" alt=" 循环转晕了解决方法 " > <a href="content.php?id=<?php%20echo%20%24id;?>"> <?php echo $array["link"]; ?> </a> </td> <?php } // 对应elseif 3 ?> <div class="clear"> </div>