we are geting first 500 record form table using php and mysql mysql_connect("hostname", "username","") mysql_select_db("databasename"); $sql = "SELECT * FROM table ORDER BY id DESC LIMIT 50"; $result = mysql_query($sql); while ($query = mysql_fetch_assoc($result)) { echo "$query[fieldname1] $query[fieldname2] <br/>"; }