<?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;
}
}
}