You would simply use the WHERE and LIMIT clauses in your MySQL select statement. For example,
SELECT * from mytable; selects all rows from a table named mytable.
SELECT col1, col2 from mytable; selects only the columns entitled col1 and col2 from mytable.
SELECT col1, col2 from mytable WHERE col1 = 1; selects only the columns entitled col1 and col2 from records where col1 is the value 1.
SELECT col1, col2 from mytable WHERE col1 = 1 LIMIT 10; does the same as the previous line only selects just the first ten records it finds, regardless of how many fulfill the WHERE criteria.
Administrator
Staff Writer
Reputation Points: 1422
Solved Threads: 163
The Queen of DaniWeb
Offline 13,646 posts
since Feb 2002