一段PHP查询语句,请问怎么写?
发布网友
发布时间:2022-04-25 15:50
我来回答
共1个回答
热心网友
时间:2023-10-14 15:49
<?php
$num=array("一","二","三","四","五","六","七","八","九");
$i=1;
$max=3;
while($i<=$max){
$sql="select * from table where mingci='$i' order by id asc";
$result=mysql_query($sql);
$nums=mysql_num_rows($result);
if($nums>0){
echo "<table><tr><td>第".$num[$i-1]."名</td></tr>";
}
while($source=mysql_fetch_row($result)){
echo "<tr><td>".$source[3]."</td></tr>";
}
if($nums>0){
echo "</table>";
}
$i++;
}