MYSQL QUERY SYNTAX?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
robertbarzyk
Forum Newbie
Posts: 19
Joined: Tue Oct 06, 2009 4:12 pm

MYSQL QUERY SYNTAX?

Post by robertbarzyk »

$result = mysql_query("SELECT * FROM yesterday ORDER BY points DESC LIMIT 0,5") ;

what i want to do is skip the first 5 rows
and get the second 5 rowes (rows 6-10)
know any ways of doing this ?
jegan.aaodis
Forum Newbie
Posts: 15
Joined: Fri Oct 09, 2009 1:56 am

Re: MYSQL QUERY SYNTAX?

Post by jegan.aaodis »

Hi,

Use thsi query

$result = mysql_query("SELECT * FROM yesterday ORDER BY points DESC LIMIT 5,5") ;

The First five is used to get the records from ie 6,7,8,9,10..etc..,
The next five is to send the total records to show after 6.
I Hope this helps you.

Thanks
Post Reply