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

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

java - More than one row with the given identifier was found: 1, for class: com.model.Diagnosis -