In PHP – MySQL the LIMIT clause is used with the SELECT statement to restrict the number of rows in the result set. The Limit Clause accepts one or two arguments which are offset and count.The value of both the parameters can be zero or positive integers.
Offset:It is used to specify the offset of the first row to be returned.
Count:It is used to specify the maximum number of rows to be returned.
## Limit
$sql = "SELECT * FROM Orders LIMIT 30";
## Limit & Offset
$sql = "SELECT * FROM Orders LIMIT 10 OFFSET 15";
You could also use a shorter syntax to achieve the same result: $sql = "SELECT * FROM Orders LIMIT 15, 10";
The SQL query below says "return only 10 records, start on record 16 (OFFSET 15)":