Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ever heard of LIMIT(x,y)?

Status
Not open for further replies.

BonesJunior

Programmer
Aug 4, 2000
2
SE
I heard somebody say that if you use LIMIT(x,y) then the result will be y rows starting from x. Is that correct?<br>I can't seem to get this to work properly.
 
Hi Bones,

$offset = 5 ; # start from the 5th. (x)
$limit = 10 ; # show ten records (y)

$SQL = &quot;SELECT * FROM mytable LIMIT $offset,$limit&quot;;

... bla bla

query might find 100 records but will only
return 10 records starting from the 5th record.
(i.e. records 5 to 15 are returned).

hope this helps
Ken
----------------------------------------------------------
----------------------------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top