zoukankan      html  css  js  c++  java
  • 封装

    <?php

    class Dadb

    {

      public $host = "localhost";

      public $uid = "uid";

      public $pwd = "pwd";

      public $dbname = "test";

      function query($sql,$type=1)

      {

        $db = new MySQLi($this->host,$this->uid,$this->pwd,$this->dbname);

        $result = $db->query($sql);

        if($type)

        {

          return $result->fetch_all();

        }

        else

        {

          return $result;

        }

      }

    }

  • 相关阅读:
    Spock
    Spock
    Spock
    Spock
    Spock
    Spock
    Python3 与 Python2 的不同
    python 文件处理
    Django 数据迁移
    Python 特殊方法
  • 原文地址:https://www.cnblogs.com/gyzown/p/6894236.html
Copyright © 2011-2022 走看看