 |
|
|
| View previous topic :: View next topic |
| Author |
Message |
jojiju
Joined: 23 May 2008 Posts: 1
|
Posted: Fri May 23, 2008 8:54 am Post subject: Call to undefined method MDB2_Error::query() |
|
|
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 |
|
 |
mark

Joined: 07 Jan 2007 Posts: 1013
|
Posted: Fri May 23, 2008 10:32 am Post subject: |
|
|
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 |
|
 |
|
|
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
|
|