You use a SELECT statement with conditions.
Example: without looking at the contents of the records at all:
SELECT * from $table
LIMIT 5,5
This skips 5 records, then retrieves the next five.
Or, you get rows based upon expressions used to compare fields in the table against desired values. For example:
SELECT * from $table
WHERE firstname = "fred" and age = 23