php - Echo the 2 last columns of tabel -
i have table , want echo 2 last rows of tabel, used below code last 1 showed, problem.
$result1 =(mysql_fetch_array(mysql_query("select * $table order id desc limit 2"))); print $result1['time'];
for 2 or more rows need loop it
$sql = mysql_query("select * $table order id desc limit 2") while($row=mysql_fetch_array($sql)) { echo $row['time']."<br>"; }
Comments
Post a Comment