本文整理匯總了PHP中ADODB_Pear_error函數的典型用法代碼示例。如果您正苦於以下問題:PHP ADODB_Pear_error函數的具體用法?PHP ADODB_Pear_error怎麽用?PHP ADODB_Pear_error使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了ADODB_Pear_error函數的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _connect
/**
* Connect to database by using the given DSN string
*
* @access private
* @param string DSN string
* @return mixed Object on error, otherwise bool
*/
function _connect($dsn)
{
if (is_string($dsn) || is_array($dsn)) {
if (!$this->db) {
$this->db = ADONewConnection($dsn);
if ($err = ADODB_Pear_error()) {
return PEAR::raiseError($err);
}
}
} else {
return PEAR::raiseError('The given dsn was not valid in file ' . __FILE__ . ' at line ' . __LINE__, 41, PEAR_ERROR_RETURN, null, null);
}
if (!$this->db) {
return PEAR::raiseError(ADODB_Pear_error());
} else {
return true;
}
}
示例2: _connect
/**
* Connect to database by using the given DSN string
*
* @access private
* @param string DSN string
* @return mixed Object on error, otherwise bool
*/
function _connect($dsn)
{
if (is_string($dsn) || is_array($dsn)) {
if (!$this->db) {
$this->db =& ADONewConnection($this->options['db_type']);
if ($err = ADODB_Pear_error()) {
return PEAR::raiseError($err);
}
}
$dbconnected = $this->db->Connect($this->options['db_host'], $this->options['db_user'], $this->options['db_pass'], $this->options['db_name']);
if (!$dbconnected) {
PEAR::raiseError('Unable to connect to database');
}
} else {
return PEAR::raiseError('The given dsn was not valid in file ' . __FILE__ . ' at line ' . __LINE__, 41, PEAR_ERROR_RETURN, null, null);
}
if (!$this->db) {
return PEAR::raiseError(ADODB_Pear_error());
} else {
return true;
}
}