限制输出图片的数量 php代码
echo"<tablewidth=900hight=140align=center><tr>";$sql="selectuchome_space.uid,uchome_s...
echo "<table width=900 hight=140 align=center> <tr>";
$sql="select uchome_space.uid,uchome_spacefield.resideprovince ,uchome_spacefield.uid from uchome_space, uchome_spacefield where uchome_space.uid = uchome_spacefield.uid and resideprovince='广东' order by lastlogin desc ";
$res=mysql_query($sql);
while($row=mysql_fetch_array($res)){
$img="data/0/".$aa=str_pad($row['uid'],3,"0",STR_PAD_LEFT)."_avatar_small.jpg";
$i=1;
foreach((array)$img as $ig){
if(file_exists($ig)){
echo "<td class=iner ><img src='data/0/".str_pad($row['uid'],3,"0",STR_PAD_LEFT)."_avatar_small.jpg'><br/></td>";
$i++;}
if($i >= 30)
break;
}
}
echo "</tr></table>"; 展开
$sql="select uchome_space.uid,uchome_spacefield.resideprovince ,uchome_spacefield.uid from uchome_space, uchome_spacefield where uchome_space.uid = uchome_spacefield.uid and resideprovince='广东' order by lastlogin desc ";
$res=mysql_query($sql);
while($row=mysql_fetch_array($res)){
$img="data/0/".$aa=str_pad($row['uid'],3,"0",STR_PAD_LEFT)."_avatar_small.jpg";
$i=1;
foreach((array)$img as $ig){
if(file_exists($ig)){
echo "<td class=iner ><img src='data/0/".str_pad($row['uid'],3,"0",STR_PAD_LEFT)."_avatar_small.jpg'><br/></td>";
$i++;}
if($i >= 30)
break;
}
}
echo "</tr></table>"; 展开
2个回答
展开全部
$sql="select uchome_space.uid,uchome_spacefield.resideprovince ,uchome_spacefield.uid from uchome_space, uchome_spacefield where uchome_space.uid = uchome_spacefield.uid and resideprovince='广东' order by lastlogin desc "
加一个limit限制
加一个limit限制
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询