Driver = new $d(); // 根据驱动名称生成相应的数据库驱动类 return true; } } return false; //注册驱动失败 } function Connect($host,$user,$passwd,$database) //连接数据库的函数 { $this->Driver->host=$host; $this->Driver->user=$user; $this->Driver->passwd=$passwd; $this->Driver->database=$database; $this->connection = $this->Driver->Connect(); } function Close() //关闭数据库函数 { $this->Driver->close($this->connection); } function Query($queryStr) //数据库字符串查询函数 { return $this->Driver->query($queryStr,$this->connection); } function getRows($res) //查找行 { return $this->Driver->getRows($res); } function getRowsNum($res) //取得行号 { return $this->Driver-> getRowsNum ($res); } } ? >