PEAR Forum :: PHP Extension and Application Repository

PEAR Forum Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Call to undefined method MDB2_Error::query()

 
Post new topic   Reply to topic    PEAR Forum Forum Index -> Database
View previous topic :: View next topic  
Author Message
jojiju



Joined: 23 May 2008
Posts: 1

PostPosted: Fri May 23, 2008 8:54 am    Post subject: Call to undefined method MDB2_Error::query() Reply with quote

hello,
I am using MDB2 classs. I called the following in the constructor

function __construct() {
$this->_oConn =& MDB2::connect(DSN);

if (PEAR::isError($this->_oConn) ) {

catchExc($this->_oConn->getMessage());
}
}

function _screenNameExists($sScreenName) {

// check for matching screen name
$sql = "SELECT
account_id
FROM
".PREFIX."_accounts
WHERE
account_screenname='".$sScreenName."'
and deleted=0";


if (PEAR::isError($rsTmp = $this->_oConn->query($sql))) {

catchExc($rsTmp->getMessage());
return false;
}

// return matching number of rows
$return = $rsTmp->numRows();
return $return;
}

call to undefined method MDB@_Error::query() occurs please help.
Back to top
View user's profile Send private message
mark



Joined: 07 Jan 2007
Posts: 1053

PostPosted: Fri May 23, 2008 10:32 am    Post subject: Reply with quote

Are you sure that you're showing all important parts of your code here?

Although there is an error check in the constructor, there seems to be an issue with the connection. Please insert the block from the constructor also directly before the query() call:
Code:

if (PEAR::isError($this->_oConn) ) {
    catchExc($this->_oConn->getMessage());
}
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    PEAR Forum Forum Index -> Database All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



PEAR Forum topic RSS feed 
Powered by phpBB © 2001, 2005 phpBB Group

Provided by Ministry of Web developement

'Actiemonitor' online projectmanagement software