Note that in the first format (comma-separated), the first number is the offset and the second the number of rows, while that is inverted for the second format. How's that for confusing? ?
@thraddashOct 12.2009 — #Just because I was asked on my profile:
[code=php]$result = mysql_query("SELECT * FROM yesterday ORDER BY points DESC LIMIT 0,5") ; //1-5 $result = mysql_query("SELECT * FROM yesterday ORDER BY points DESC LIMIT 5,5") ; //6-10 $result = mysql_query("SELECT * FROM yesterday ORDER BY points DESC LIMIT 10,5") ; //11-15
$page_size = 5; $page_num = 2; $result = mysql_query('SELECT * FROM yesterday ORDER BY points DESC LIMIT ' . ($page_size * ($page_num - 1)) . ',' . $page_size, $conn) ;[/code]