To get the first 5 in the order they were added to the database ...

select * from tablename limit 5;

or, for the 5 topmost, highest value ....

select * from tablename where somefield.value > somecriteria order by 
tablename.somefield limit 5

Now check docs for exact synatx - TOP may be used in place of LIMIT

HTH - Miles Thompson

PS  If you are not familiar with SQL, there are a number of tutorials on 
the web which will be well worth a couple of hours of your time. The 
DevShed and WebMonkey sites come to mind. /mt

At 07:33 AM 11/18/01 +0000, alfareees alfareees wrote:
>how can I take the first 5 records from access xp
>by odbc or PHP ?
>Get your FREE download of MSN Explorer at
>PHP Database Mailing List (
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]

PHP Database Mailing List (
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to