Hi, I am trying to display some records from a mysql database into a php page. It is a list of people, position etc and their salary. I need a php or mysql code which will display only the first 5 people with the highest salary, thereby not showing any of the other records on the database.
Any help from members on this forum would be greatly appreciated as I desperately need to get it to work.
Thanks
Records Displayed
Moderator: General Moderators
- harrisonad
- Forum Contributor
- Posts: 288
- Joined: Fri Oct 15, 2004 4:58 am
- Location: Philippines
- Contact:
Code: Select all
$query = "
SELECT * FROM tablename
ORDER BY salary DESC LIMIT 5";