$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数据输出 ?>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn