您现在的位置是:首页 > 全栈开发 > php

php 测试

admin2019-06-18php 人已围观

简介php 测试

<?php
include_once "../../inc/config.inc.php";
include_once "../../inc/mysql.inc.php";
include_once "../../inc/wipe.inc.php";

$conn = connect();

header('Content-type:text/json'); // 返回json


$sql = "SELECT s.*,h.hospital_name FROM storey as s INNER JOIN hospital h ON s.hospital_id = h.hospital_id AND s.is_delete='1'  ORDER BY  s.hospital_id  ASC limit  " ;

$rs = " select count(*) num from  storey WHERE is_delete=1"; //可以显示出总页数

@$allNum = allNews($conn,$rs); //显示总页数的函数
@$pageNum = empty($_GET["pageNum"])?1:$_GET["pageNum"];
@$pageSize = empty($_GET["listrows"])?10:$_GET["listrows"]; //约定没页显示几条信息
@$endPage = ceil($allNum/$pageSize);  //几页
@$array = news($conn,$sql,$pageNum,$pageSize);


$tots =array('totalRows' => $allNum ,'totalPages' => $endPage);

$obj =[
    "users" => $array,
    "pags" => $tots,
];

echo $str=json_encode($obj);//将数组进行json编码

很赞哦!32

文章评论

      匿名评论
    • 评论
    人参与,条评论

站点信息

  • 建站时间:2018-12-23
  • 网站程序:帝国CMS7.5
  • 文章统计: 183
  • 文章评论:490条
  • 统计数据百度统计
  • 微信公众号:扫描二维码,关注我们