fetch——row

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

 

posted @ 2017-04-11 21:26  get("新技能")  阅读(165)  评论(0编辑  收藏  举报