Page 1 of 1

how do i make a select on only the 5 first results

Posted: Sun Dec 14, 2003 1:50 am
by pelegk2
i want when i make a select on a db to get only the first 5 on loop over them
(and not needingto make a counter from 1 to 5)
thanks
peleg

Posted: Sun Dec 14, 2003 2:00 am
by Paddy
Use limit. For example,

Code: Select all

SELECT * FROM `table1` LIMIT 0 , 5
Should work for your what you want.