if ($page){
$page_size=20;
$result=mysql_query($ query);
#$message_count=mysql_result($result,0,"total");
$message_count=10;
$page_count=ceil($message_count/$page_size);
$offset =($page-1)*$page_size;
$query=$query." order by date desc limit $offset, $page_size";
$result=mysql_query($query);
if( $result){
$rows=mysql_num_rows($result);
if($rows!=0){
while($myrow=mysql_fetch_array($result)){
echo "< tr>";
echo "
< /td>"; echo " | $myrow[id] $myrow[tradetype] $myrow[address] $myrow[wuye]($myrow[housetype ])[$myrow[date]]"; echo " | ";
echo "
Details | " ;
echo "";
}
}
else echo "
No records meeting your criteria were found & lt;/td> |
";
}
$ prev_page=$page-1;
$next_page=$page 1;
echo "
";
echo "".$page."/".$ page_count."page ";
if ($page<=1){
echo "|First page|";
}
else{
echo "
|First page|";
}
echo " ";
if ($prev_page<1){
echo "| Previous page|";
}
else{
echo "
|Previous page|";
}
echo " ";
if ($next_page>$page_count){
echo "|next page|";
}
else{
echo "
|Next page|";
}
echo " ";
if ($page>=$page_count){
echo "|last page|";
}
else{
echo "
|last page|}
echo "
";
}
else{
echo "
There is no rental information yet!
";
}
echo "
";
?>