时间:2021-07-01 10:21:17 帮助过:19人阅读
$query=mysql_query("select * from content order by id desc limit 0,10");
while ($row=mysql_fetch_array($query)) {
?>
js文件
代码如下:
result.php
代码如下:输出
include("conn.php");
$page = intval($_GET['page']); //获取请求的页数
$start = $page*5;
$query=mysql_query("select * from content order by id desc limit $start,5");
while ($row=mysql_fetch_array($query)) {
$arr[] = array(
'content'=>$row['message'],
'author'=>$row['id'],
'date'=>date('m-d H:i',strtotime($row['updatetime']))
);
}
echo json_encode($arr); //转换为json数据
?>