<?php class DBDA { public $hostname="localhost"; public $username="root"; public $mima="123"; public $dbname="zhousan"; public function Query($str,$t=0) { $obj=new MySQLi($this->hostname,$this->username,$this->mima,$this->dbname); $fanhui=$obj->query($str); if($t==0) { return $fanhui; } else { while($m=$fanhui->fetch_row()) { $attr[]=$m; } return json_encode($attr); } } } ?> DBDB.class.php
时间: 2024-10-07 00:52:42