Solved. Forget to assigning the return value of the method to anything. :S Sorry. Márcio > -----Original Message----- > From: MEM [mailto:talofo@xxxxxxxxx] > Sent: sábado, 1 de Agosto de 2009 17:13 > To: 'php-general@xxxxxxxxxxxxx' > Subject: Newbie: can't access a return value. > > Hi all, > > When I do this: > $associacao_dao->listar($limit, $offset); > > I can var_dump the correct $limit. > I can var_dump the correct $offset. > > I CAN'T access the object that I was hoping to get, called $records. > > After this, I was hoping to do var_dump($records); and see the stdClass > object. > > > > > Here is the listar method: > > public function listar($limit=null, $offset=null) > { > $query_str="SELECT * FROM associacao"; > > $stmt = $this->_dbh->prepare($query_str . ' LIMIT ?, ?'); > $stmt->bindParam(1, $limit, PDO::PARAM_INT); > $stmt->bindParam(2, $offset, PDO::PARAM_INT); > > $stmt->execute(); > > $records = $stmt->fetchAll(PDO::FETCH_OBJ); > > return $records; > } > > > > Any help will be greatly appreciated. > > > Thanks a lot in advance, > Márcio -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php