The loop is spinning.
$sql = "Select * from href where id= $id order by link";
$query =mysql_query ($sql);
while ($array =mysql_fetch_array ($query)) {
?>
Src= "List.files/biao_33.gif" width=11 align=absmiddle>
">
}?>
It's a big one, but I'd like to change it when the ID's not 1 2, so then here
$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)) {
?>
Src= "List.files/biao_33.gif" width=11 align=absmiddle>
">
}}
?>
ElseIf ($id ==1) {
Src= "List.files/biao_33.gif" width=11 align=absmiddle>
">
}
ElseIf ($id ==2) {
Src= "List.files/biao_33.gif" width=11 align=absmiddle>
">
}
How to put it in that loop and get dizzy. Actually, I don't know. Where should I put it? I've tried several places.
------Solution--------------------
$array {"link"};? Where did you read that? The wrong. It should be $array["link", enclosed in square brackets.
It is recommended that you change to a professional editor, such as Notepad++,eclipse, which can be highlighted in PHP syntax. In addition, the switch statement is more appropriate for your situation.
PHP code
!--? 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)) {?--"> !--? php echo $array ["link"];?--"!--? php}//corresponding while}//corresponding if else if ($id ==1) {//2?-- ">!--? php echo $array [" link "];?--"!--? php}/ /corresponds to the else if ($id ==1)//2 else if ($id ==2) {//3?--">"!--? PHP EC
Ho $array ["link"];?--"!--? php}//corresponding ElseIf 3?-->