Jump to content

Only get the last 20 records


DrTrans

Recommended Posts

<?php
     $connect = mysql_connect("localhost","damgears_evil","damgears");
     mysql_select_db("damgears_evil");
     $query = mysql_query("SELECT * FROM titles ORDER BY id DESC");

     while($row = mysql_fetch_assoc($query))
	{
		$dbid = $row['id'];
		$dbfname = $row['fname'];
		$dblname = $row['lname'];
		$dbkey = $row['key'];
		$dbskey = $row['skey'];
		$dbname = $row['sname'];
		$title = $row['title'];
		$dbstatus = $row['status'];
		$dbdate = $row['date'];
		$region = $row['region'];
	print "<center>\"$title\"<br>";
	print "by $dbname <i>for $dbfname $dblname</i><br><br></center>";

	}
    ?>

Link to comment
https://forums.phpfreaks.com/topic/177947-only-get-the-last-20-records/
Share on other sites

  Quote

I was just noting the alternate syntax incase he ever needed it.

 

or did why i did and not research and just make PHP (or whatever) ignore the first ten and limit 30.

 

It's not an "alternate syntax" for the desired results.  That would imply that using LIMIT 10,20 would yield the same results as LIMIT 20.  Which it doesn't.  Using LIMIT 0,20 would be considered an alternative syntax.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.