<legend id='6AAxH'><style id='6AAxH'><dir id='6AAxH'><q id='6AAxH'></q></dir></style></legend>

  • <small id='6AAxH'></small><noframes id='6AAxH'>

      <tfoot id='6AAxH'></tfoot>

        <bdo id='6AAxH'></bdo><ul id='6AAxH'></ul>

      1. <i id='6AAxH'><tr id='6AAxH'><dt id='6AAxH'><q id='6AAxH'><span id='6AAxH'><b id='6AAxH'><form id='6AAxH'><ins id='6AAxH'></ins><ul id='6AAxH'></ul><sub id='6AAxH'></sub></form><legend id='6AAxH'></legend><bdo id='6AAxH'><pre id='6AAxH'><center id='6AAxH'></center></pre></bdo></b><th id='6AAxH'></th></span></q></dt></tr></i><div id='6AAxH'><tfoot id='6AAxH'></tfoot><dl id='6AAxH'><fieldset id='6AAxH'></fieldset></dl></div>
      2. php读取数据库里的数据以JSON格式返回数据

        时间:2024-05-12
            <tbody id='7Y8Iq'></tbody>
          <legend id='7Y8Iq'><style id='7Y8Iq'><dir id='7Y8Iq'><q id='7Y8Iq'></q></dir></style></legend>
          <i id='7Y8Iq'><tr id='7Y8Iq'><dt id='7Y8Iq'><q id='7Y8Iq'><span id='7Y8Iq'><b id='7Y8Iq'><form id='7Y8Iq'><ins id='7Y8Iq'></ins><ul id='7Y8Iq'></ul><sub id='7Y8Iq'></sub></form><legend id='7Y8Iq'></legend><bdo id='7Y8Iq'><pre id='7Y8Iq'><center id='7Y8Iq'></center></pre></bdo></b><th id='7Y8Iq'></th></span></q></dt></tr></i><div id='7Y8Iq'><tfoot id='7Y8Iq'></tfoot><dl id='7Y8Iq'><fieldset id='7Y8Iq'></fieldset></dl></div>

              <small id='7Y8Iq'></small><noframes id='7Y8Iq'>

                <bdo id='7Y8Iq'></bdo><ul id='7Y8Iq'></ul>
                  <tfoot id='7Y8Iq'></tfoot>

                • php读取数据库里的数据以JSON格式返回数据的代码如下:
                  $sql="select * from users";
                  $result=mysqli_query($link,$sql); //$link 链接数据库实例,自己写的包含文件conn.php里;
                   
                  if($result && mysqli_num_rows($result)>0){
                      $data=array(); //定义数组对象;
                      while($rs=mysqli_fetch_assoc($result)){
                          $data[]=$rs; //把结果集里的数据赋值给$data数组变量;    
                      }
                      if($data){
                          echo json_encode($data); //把数组对象转换成json;
                      }
                  }
                   
                  //释放结果集
                  mysqli_free_result($result);
                  //关闭链接对象实例
                  mysqli_close($conn);
                   
                  上一篇:php使用preg_match()函数验证ip地址的方法 下一篇:没有了

                  相关文章

                  <small id='CbcF4'></small><noframes id='CbcF4'>

                  <legend id='CbcF4'><style id='CbcF4'><dir id='CbcF4'><q id='CbcF4'></q></dir></style></legend>
                • <i id='CbcF4'><tr id='CbcF4'><dt id='CbcF4'><q id='CbcF4'><span id='CbcF4'><b id='CbcF4'><form id='CbcF4'><ins id='CbcF4'></ins><ul id='CbcF4'></ul><sub id='CbcF4'></sub></form><legend id='CbcF4'></legend><bdo id='CbcF4'><pre id='CbcF4'><center id='CbcF4'></center></pre></bdo></b><th id='CbcF4'></th></span></q></dt></tr></i><div id='CbcF4'><tfoot id='CbcF4'></tfoot><dl id='CbcF4'><fieldset id='CbcF4'></fieldset></dl></div>

                    <bdo id='CbcF4'></bdo><ul id='CbcF4'></ul>
                    <tfoot id='CbcF4'></tfoot>