a conexao.php
<? include_once('lib/adodb/adodb.inc.php'); class conexao { private $db, $server, $user, $pwd, $database; public function connect() { $this->configs(); $this->db = &ADONewConnection('mysql'); $this->db->PConnect($this->server, $this->user, $this->pwd, $this->database); $this->db->SetFetchMode(ADODB_FETCH_ASSOC); } public function close() { $this->db->Close(); } private function configs() { $this->server = 'localhost'; $this->user = 'teste'; $this->pwd = 'teste'; $this->database = 'teste'; } } ?>
e a users.php
<? class users { private $id, $login, $senha, $nivel; private $db; function __construct() { $this->db = new conexao(); $this->db->connect(); } /** * Pega informacoes do usuario * @return array */ function getUser() { $rs = $this->db->Execute("SELECT * FROM users"); if (!$rs) print $this->db->ErrorMsg(); else print_r($rs->fields); $rs->Close(); } function getNivel() { } function setUser() { } function setNivel() { } function updateUser() { } function removeUser() { } } ?>
ok... no meu index.php tenho...
<? include_once("classes/conexao.php"); include_once("classes/users.php"); $users = new users(); $users->getUser(); ?>
porem qndo abro a pagina.. ele retorna assim:
Fatal error: Call to undefined method conexao::Execute() in /home/salsa/classes/users.php on line 15
alguem sabe pq rola isso?
não sei oq to fazendo de errado...
valeu