I have a simple task to do using PHP dealing with pagination. The idea is simple, I want to do mysql_fetch_array of my SQL query :
SELECT Name, Email, CellPhone FROM Users WHERE Username = '$Username' LIMIT $x, 26;
if that query has 26 rows, means I have to show ‘NEXT PAGE’ button. but, I just want to show to user only first 25 rows of it.
the 26th row is just for indicator whether ‘NEXT PAGE’ button should be shown or not.
currently, I’m using WHILE to display the rows, but how to ‘stop’ WHILE after 25 times loop?
while($rowSQL = mysql_fetch_array($sql))
{
echo "bla-bla-blah";
}
This should do the trick: