Hi there,
thanks for your attention.
I know that this question is asked many times in many threads(Forum pagination).But i can't match any of them with my own code...so if some one does a favor to me and edit my code... he/she had made a big please.
Here's my codešThe pagination parts)
$query = "SELECT * FROM messages WHERE message != ' ' ORDER BY messageid LIMIT 0,30";
$result=mysql_query($query);
$num = mysql_num_rows($result);
$nopages=ceil($num / 10);
[codes...]
$i=0;
while($i < $nopages){
$ii= $i + 1;
echo "[ <a href= 'forum.php?page=$ii'>$ii</a> ] " ;
++$i;
}
[some other codes...]
if(isset($GET['page'])){
$currentpage = $GET['page'];
} else {
$currentpage = 1;
}
$max = $currentpage * 10;
$min = $max - 10;
$i = 0;
while ($i < $min ) {
++$i;
}
while($i<$num)
{
$rec=mysql_fetch_array($result);
$username=$rec['username'];
$firstname=$rec['firstname'];
$lastname=$rec['lastname'];
[continues echoing the message]
}
where's the problem then?thanks, bye