$q=mysql_query("SELECT * FROM `login` ORDER BY id DESC LIMIT 3"); while($row=mysql_fetch_array($q)){ echo $row['uname']; }