Forum Moderators: coopster
$result = mysql_query("SELECT * FROM celebrities");
while ( $row = mysql_fetch_array($result) ) {
echo($row["url"]);
}
If I only want to display the first 25 results and then 26-50 somewhere else. What is the code to only display a certain section of the results so I can do this?
to display first 25:
$result = mysql_query("SELECT * FROM celebrities LIMIT 0, 25");
while ( $row = mysql_fetch_array($result) ) {
echo($row["url"]);
}
//to display 26-50:
$result = mysql_query("SELECT * FROM celebrities LIMIT 25, 25");
while ( $row = mysql_fetch_array($result) ) {
echo($row["url"]);
}
0 is first, so the 25th is row[24].
Best regards
Michal Cibor