當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ADODB_PEAR_Error函數代碼示例

本文整理匯總了PHP中ADODB_PEAR_Error函數的典型用法代碼示例。如果您正苦於以下問題:PHP ADODB_PEAR_Error函數的具體用法?PHP ADODB_PEAR_Error怎麽用?PHP ADODB_PEAR_Error使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了ADODB_PEAR_Error函數的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: ADODB_PEAR_Error

 function &CacheGetArray($secs2cache, $sql = false, $inputarr = false)
 {
     global $ADODB_COUNTRECS;
     $savec = $ADODB_COUNTRECS;
     $ADODB_COUNTRECS = false;
     $rs =& $this->CacheExecute($secs2cache, $sql, $inputarr);
     $ADODB_COUNTRECS = $savec;
     if (!$rs) {
         if (defined('ADODB_PEAR')) {
             $cls = ADODB_PEAR_Error();
             return $cls;
         } else {
             $false = false;
             return $false;
         }
     }
     $arr =& $rs->GetArray();
     $rs->Close();
     return $arr;
 }
開發者ID:dasatti,項目名稱:dashboard,代碼行數:20,代碼來源:adodb.inc.php

示例2: connect

 /**
  * Create a new DB object and connect to the specified database
  *
  * @param $dsn mixed "data source name", see the DB::parseDSN
  * method for a description of the dsn format.  Can also be
  * specified as an array of the format returned by DB::parseDSN.
  *
  * @param $options mixed if boolean (or scalar), tells whether
  * this connection should be persistent (for backends that support
  * this).  This parameter can also be an array of options, see
  * DB_common::setOption for more information on connection
  * options.
  *
  * @return object a newly created DB connection object, or a DB
  * error object on error
  *
  * @see DB::parseDSN
  * @see DB::isError
  */
 function connect($dsn, $options = false)
 {
     if (is_array($dsn)) {
         $dsninfo = $dsn;
     } else {
         $dsninfo = DB::parseDSN($dsn);
     }
     switch ($dsninfo["phptype"]) {
         case 'pgsql':
             $type = 'postgres7';
             break;
         case 'ifx':
             $type = 'informix9';
             break;
         default:
             $type = $dsninfo["phptype"];
             break;
     }
     if (is_array($options) && isset($options["debug"]) && $options["debug"] >= 2) {
         // expose php errors with sufficient debug level
         @(include_once "adodb-{$type}.inc.php");
     } else {
         @(include_once "adodb-{$type}.inc.php");
     }
     @($obj = NewADOConnection($type));
     if (!is_object($obj)) {
         $obj = new PEAR_Error('Unknown Database Driver: ' . $dsninfo['phptype'], -1);
         return $obj;
     }
     if (is_array($options)) {
         foreach ($options as $k => $v) {
             switch (strtolower($k)) {
                 case 'persist':
                 case 'persistent':
                     $persist = $v;
                     break;
                     #ibase
                 #ibase
                 case 'dialect':
                     $obj->dialect = $v;
                     break;
                 case 'charset':
                     $obj->charset = $v;
                     break;
                 case 'buffers':
                     $obj->buffers = $v;
                     break;
                     #ado
                 #ado
                 case 'charpage':
                     $obj->charPage = $v;
                     break;
                     #mysql
                 #mysql
                 case 'clientflags':
                     $obj->clientFlags = $v;
                     break;
             }
         }
     } else {
         $persist = false;
     }
     if (isset($dsninfo['socket'])) {
         $dsninfo['hostspec'] .= ':' . $dsninfo['socket'];
     } else {
         if (isset($dsninfo['port'])) {
             $dsninfo['hostspec'] .= ':' . $dsninfo['port'];
         }
     }
     if ($persist) {
         $ok = $obj->PConnect($dsninfo['hostspec'], $dsninfo['username'], $dsninfo['password'], $dsninfo['database']);
     } else {
         $ok = $obj->Connect($dsninfo['hostspec'], $dsninfo['username'], $dsninfo['password'], $dsninfo['database']);
     }
     if (!$ok) {
         $obj = ADODB_PEAR_Error();
     }
     return $obj;
 }
開發者ID:Tarendai,項目名稱:spring-website,代碼行數:98,代碼來源:adodb-pear.inc.php

示例3: ADODB_PEAR_Error

 /**
  * Return all rows. Compat with PEAR DB
  *
  * @param sql			SQL statement
  * @param [inputarr]		input bind array
  */
 function &GetAll($sql, $inputarr = false)
 {
     $rs = $this->Execute($sql, $inputarr);
     if (!$rs) {
         if (defined('ADODB_PEAR')) {
             return ADODB_PEAR_Error();
         } else {
             return false;
         }
     }
     return $rs->GetArray();
 }
開發者ID:qoire,項目名稱:portal,代碼行數:18,代碼來源:adodb.inc.php

示例4: CacheGetAll

 function CacheGetAll($secs2cache, $sql = false, $inputarr = false)
 {
     $rs = $this->CacheExecute($secs2cache, $sql, $inputarr);
     if (!$rs) {
         if (defined('ADODB_PEAR')) {
             return ADODB_PEAR_Error();
         } else {
             return false;
         }
     }
     $arr = $rs->GetArray();
     $rs->Close();
     return $arr;
 }
開發者ID:OberjukhtinIA0VWV0Allokuum,項目名稱:testmasteke.leo,代碼行數:14,代碼來源:adodb-connection.inc.php

示例5: switch

 /**
  * Create a new DB object and connect to the specified database
  *
  * @param $dsn mixed "data source name", see the DB::parseDSN
  * method for a description of the dsn format.  Can also be
  * specified as an array of the format returned by DB::parseDSN.
  *
  * @param $options mixed if boolean (or scalar), tells whether
  * this connection should be persistent (for backends that support
  * this).  This parameter can also be an array of options, see
  * DB_common::setOption for more information on connection
  * options.
  *
  * @return object a newly created DB connection object, or a DB
  * error object on error
  *
  * @see DB::parseDSN
  * @see DB::isError
  */
 function &connect($dsn, $options = false)
 {
     if (is_array($dsn)) {
         $dsninfo = $dsn;
     } else {
         $dsninfo = DB::parseDSN($dsn);
     }
     switch ($dsninfo["phptype"]) {
         case 'pgsql':
             $type = 'postgres7';
             break;
         default:
             $type = $dsninfo["phptype"];
             break;
     }
     if (is_array($options) && isset($options["debug"]) && $options["debug"] >= 2) {
         // expose php errors with sufficient debug level
         @(include_once "adodb-{$type}.inc.php");
     } else {
         @(include_once "adodb-{$type}.inc.php");
     }
     @($obj =& NewADOConnection($type));
     if (!is_object($obj)) {
         return new PEAR_Error('Unknown Database Driver: ' . $dsninfo['phptype'], -1);
     }
     if (is_array($options)) {
         $persist = !empty($options['persistent']);
     } else {
         $persist = true;
     }
     if ($persist) {
         $ok = $obj->PConnect($dsninfo['hostspec'], $dsninfo['username'], $dsninfo['password'], $dsninfo['database']);
     } else {
         $ok = $obj->Connect($dsninfo['hostspec'], $dsninfo['username'], $dsninfo['password'], $dsninfo['database']);
     }
     if (!$ok) {
         return ADODB_PEAR_Error();
     }
     return $obj;
 }
開發者ID:qoire,項目名稱:portal,代碼行數:59,代碼來源:adodb-pear.inc.php


注:本文中的ADODB_PEAR_Error函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。