Modern PHP: namespace's practice

--- mysql_trait.php ---

host = $host;
        $this->user = $user;
        $this->pwd = $pwd;
        $this->db = $db;
    }
    
    public function connect()
    {
        $this->connect = mysqli_connect($this->host, $this->user, $this->pwd);
        mysqli_select_db($this->connect, $this->db);
    }
    
    public function query($table, $arr_fields = array(), $order_by = false)
    {
        
        $sql = 'SElECT * FROM {$table}';
        
        return mysqli_query($this->connect, $sql);
    }
}

--- News.php ---

host = $host;
            //var_dump($this->host);
            //$db = new m
            //echo 232323;
        }
        
        
        public function latestNews()
        {
            
        }
    
    }

--- test.php ---

你可能感兴趣的:(Modern PHP: namespace's practice)