21,893
社区成员




$sql=mysql_query("select * from tb where type='abc' and checkstate=1");
$info = array();
while($row=mysql_fetch_array($sql)){
$info[]=$row;
}
$total = count($info);
$string = "";
for ($i=0;$i<$total;$i++){
$string.="<a href='".$info[$i]['link']."'>".$info[$i]['title']."</a>";
}
echo $string;
$sql = "SELECT * FROM tb WHERE type='abc' and checkstate=1;";
$result = mysql_query($sql);
while($row = mysql_fetch_assoc($result)){
echo '<a href="'.$row['link'].'">'.$row['title'].'</a>';
}
mysql_free_result($result);