php5.3的写法
<?php
$result = mysql_query(“SELECT * FROM Browser ORDER BY aid DESC limit 0,10”);
while($row = mysql_fetch_array($result))
{
$tm = mysubstr($row[‘tm’],0,33);
echo “<li><a href=/view.php?aid=”.$row[‘aid’].”>”;
echo $tm;
echo “</a></li>”;
}

?>
php5.6的写法
<?php
$result = mysqli_query($conn,”SELECT * FROM Browser ORDER BY aid DESC limit 0,10″);
while($row = mysqli_fetch_array($result))
{
$tm = cutstr($row[‘tm’],33);
echo “<li><a href=/view.php?aid=”.$row[‘aid’].”>”;
echo $tm;
echo “</a></li>”;
}

?>

发表回复