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 "
";
echo " | ";
echo "$myrow[id] $myrow[tradetype] $myrow[address] $myrow[wuye]($myrow[housetype])[$myrow[date]]"; echo " | ";
echo "详细内容 | ";
echo "
";
}
}
else echo "
没有找到满足你条件的记录 & lt;/td> |
";
}
$prev_page=$page-1;
$next_page=$page 1;
echo "
";
echo " 第".$page."/".$page_count."页 ";
if ($pageecho "|第一页|";
}
else{
echo "
|第一页|";
}
echo " ";
if ($prev_pageecho "|上一页|";
}
else{
echo "
|上一页|";
}
echo " ";
if ($next_page>$page_count){
echo "|下一页|";
}
else{
echo "
|下一页|";
}
echo " ";
if ($page>=$page_count){
echo "|最后一页|";
}
else{
echo "
|最后一页|";
}
echo "
";
}
else{
echo "
现在还没有房屋租赁信息!
";
}
echo "
";
?>