当前位置: 首页>>代码示例>>PHP>>正文


PHP ADOConnection类代码示例

本文整理汇总了PHP中ADOConnection的典型用法代码示例。如果您正苦于以下问题:PHP ADOConnection类的具体用法?PHP ADOConnection怎么用?PHP ADOConnection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ADOConnection类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: doquote

 /**
  * Override the default `doquote` method to better sanitize numeric values.
  *
  * @param ADOConnection $db
  * @param mixed $value
  * @param string $type
  * @return mixed
  */
 public function doquote(&$db, $value, $type)
 {
     switch ($type) {
         case 'L':
         case 'I':
         case 'I1':
         case 'I2':
         case 'I4':
         case 'I8':
         case 'F':
         case 'N':
             if (!is_numeric($value)) {
                 if (is_null($value)) {
                     return null;
                 }
                 if ($value === true) {
                     return 1;
                 }
                 if ($value === false) {
                     return 0;
                 }
                 $db->outp_throw('Numeric field type "' . $type . '" requires numeric value.', 'DOQUOTE');
                 return 0;
             }
         default:
             return parent::doquote($db, $value, $type);
     }
 }
开发者ID:Zyqsempai,项目名称:amanet,代码行数:36,代码来源:model.php

示例2: __construct

 /**
  * Constructor
  *
  * @param ADOConnection $db An instance of ADOConnection.
  *
  * @throws XML_Query2XML_DBException If the ADOConnection instance passed as
  *                          argument was not connected to the database server.
  */
 public function __construct(ADOConnection $db)
 {
     if (!$db->IsConnected()) {
         throw new XML_Query2XML_DBException('ADOConnection instance was not connected');
     }
     $db->SetFetchMode(ADODB_FETCH_ASSOC);
     $this->_db = $db;
 }
开发者ID:quangbt2005,项目名称:vhost-kis,代码行数:16,代码来源:ADOdb.php

示例3: __construct

 function __construct($type, $host, $user, $pass, $db, $debug)
 {
     $this->_adoConnection = NewADOConnection($type);
     $this->_adoConnection->debug = $debug;
     $status = $this->_adoConnection->Connect($host, $user, $pass, $db);
     if (!$status) {
         throw new Exception("Không kết nối được CSDL");
     }
     $this->_adoConnection->SetCharSet('utf8');
     $this->_adoConnection->SetFetchMode(ADODB_FETCH_ASSOC);
 }
开发者ID:hopitio,项目名称:framework,代码行数:11,代码来源:DB.php

示例4: DropColumnSQL

 function DropColumnSQL($tabname, $flds)
 {
     if ($this->debug) {
         ADOConnection::outp("DropColumnSQL not supported");
     }
     return array();
 }
开发者ID:honj51,项目名称:taobaocrm,代码行数:7,代码来源:datadict-informix.inc.php

示例5: DropColumnSQL

 public function DropColumnSQL($tabname, $flds, $tableflds = '', $tableoptions = '')
 {
     if ($this->debug) {
         ADOConnection::outp("DropColumnSQL not supported");
     }
     return array();
 }
开发者ID:bermi,项目名称:akelos,代码行数:7,代码来源:datadict-generic.inc.php

示例6: BindTimeStamp

	function BindTimeStamp($d)
	{
		$d = ADOConnection::DBTimeStamp($d);
		if (strncmp($d,"'",1)) return $d;

		return substr($d,1,strlen($d)-2);
	}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:7,代码来源:adodb-oracle.inc.php

示例7:

 function &SelectLimit($sql, $nrows = -1, $offset = -1, $inputarr = false, $arg3 = false, $secs2cache = 0)
 {
     if (!preg_match('/ORDER[ \\t\\r\\n]+BY/is', $sql)) {
         $sql .= ' ORDER BY 1';
     }
     return ADOConnection::SelectLimit($sql, $nrows, $offset, $inputarr, $arg3, $secs2cache);
 }
开发者ID:katopenzz,项目名称:openemr,代码行数:7,代码来源:adodb-vfp.inc.php

示例8: queryDb

 /**
  *   Sends the sql to the database and returns the results.
  *
  *   @internal Switches between ADOConnection::Execute() and
  *    ADOConnection::SelectLimit() depending on the $query parameter's
  *    $solutionModifier "limit" and "offset" settings.
  *   Uses $query variable.
  *
  *   @param array $arSql     Array that gets a SQL query string once imploded
  *
  *   @return mixed           Anything ADOConnection::Execute() may return
  *   @throws Exception       If Database query does not work
  */
 function queryDb($arSql, $nOffset, $nLimit)
 {
     $strSql = SparqlEngineDb_SqlMerger::getSelect($this->query, $arSql);
     if ($strSql == '()') {
         return new ADORecordSet(false);
     }
     // I want associative arrays.
     $oldmode = $this->dbConn->SetFetchMode(ADODB_FETCH_ASSOC);
     if (isset($GLOBALS['debugSparql']) && $GLOBALS['debugSparql']) {
         echo 'SQL query: ' . $strSql . "\n";
     }
     if ($nLimit === null && $nOffset == 0) {
         $ret = $this->dbConn->execute($strSql);
     } else {
         if ($nLimit === null) {
             $ret = $this->dbConn->SelectLimit($strSql, -1, $nOffset);
         } else {
             $ret = $this->dbConn->SelectLimit($strSql, $nLimit, $nOffset);
         }
     }
     //... but others maybe not
     $this->dbConn->SetFetchMode($oldmode);
     if (!$ret) {
         //Error occured
         throw new Exception('ADOdb error: ' . $this->dbConn->ErrorMsg() . "\n" . $strSql);
     }
     return $ret;
 }
开发者ID:VUW-SIM-FIS,项目名称:emiemi,代码行数:41,代码来源:SparqlEngineDb.php

示例9: PrepareSP

	public function PrepareSP($sql)
	{
		if (!$this->_has_mssql_init) {
			ADOConnection::outp( "PrepareSP: mssql_init only available since PHP 4.1.0");
			return $sql;
		}
		if (is_string($sql)) $sql = str_replace('||','+',$sql);
		$stmt = mssql_init($sql,$this->_connectionID);
		if (!$stmt)  return $sql;
		return array($sql,$stmt);
	}
开发者ID:joeymetal,项目名称:v1,代码行数:11,代码来源:adodb-mssqlpo.inc.php

示例10: next

 /**
  * Fonction static permettant d'obtenir la séquence suivante
  *
  * @name DbSequence::next()
  *
  * @access public
  * @static
  * @param ADOConnection $conn Connexion valide à une base de données
  * @param string $table Table sur laquelle on doit obtenir la sequence suivante
  * @param string $column Nom de la colonne Primary Key de type numerique
  *
  * @return int Numero de séquence suivante
  */
 public static function next(ADOConnection $conn, $table, $column)
 {
     try {
         $sql = "SELECT {$column} FROM {$table} ORDER BY 1 DESC";
         $rs = $conn->SelectLimit($sql, 1);
         // Si il n'y a aucun enregistrement : insertion du premier
         if ($rs->RecordCount() == 0) {
             $id = 1;
         } else {
             while (!$rs->EOF) {
                 $id = $rs->fields[0];
                 break;
             }
             $id++;
         }
     } catch (exception $e) {
         return null;
     }
     return $id;
 }
开发者ID:pixxid,项目名称:xengine,代码行数:33,代码来源:DbSequence.class.php

示例11: MetaTables

 function MetaTables($ttype = false, $showSchema = false, $mask = false)
 {
     if ($mask) {
         $save = $this->metaTablesSQL;
         $mask = $this->qstr(strtoupper($mask));
         $this->metaTablesSQL .= " AND table_name like {$mask}";
     }
     $ret = ADOConnection::MetaTables($ttype, $showSchema);
     if ($mask) {
         $this->metaTablesSQL = $save;
     }
     return $ret;
 }
开发者ID:jnugh,项目名称:Paradise-Bird-Project,代码行数:13,代码来源:adodb-pdo_oci.inc.php

示例12:

 function &MetaTables($ttype = false, $showSchema = false, $mask = false)
 {
     if ($mask) {
         $save = $this->metaTablesSQL;
         $mask = $this->qstr($mask);
         $this->metaTablesSQL .= " like {$mask}";
     }
     $ret =& ADOConnection::MetaTables($ttype, $showSchema);
     if ($mask) {
         $this->metaTablesSQL = $save;
     }
     return $ret;
 }
开发者ID:tejdeeps,项目名称:tejcs.com,代码行数:13,代码来源:adodb-mysql.inc.php

示例13: MetaTables

 function MetaTables($ttype = false, $showSchema = false, $mask = false)
 {
     $save = $this->metaTablesSQL;
     if ($showSchema && is_string($showSchema)) {
         $this->metaTablesSQL .= " from {$showSchema}";
     }
     if ($mask) {
         $mask = $this->qstr($mask);
         $this->metaTablesSQL .= " like {$mask}";
     }
     $ret = ADOConnection::MetaTables($ttype, $showSchema);
     $this->metaTablesSQL = $save;
     return $ret;
 }
开发者ID:swapnilphalak,项目名称:crawl-anywhere,代码行数:14,代码来源:adodb-pdo_mysql.inc.php

示例14: ServerInfo

	function ServerInfo()
	{
		$arr['dialect'] = $this->dialect;
		switch($arr['dialect']) {
		case '':
		case '1': $s = 'Firebird Dialect 1'; break;
		case '2': $s = 'Firebird Dialect 2'; break;
		default:
		case '3': $s = 'Firebird Dialect 3'; break;
		}
		$arr['version'] = ADOConnection::_findvers($s);
		$arr['description'] = $s;
		return $arr;
	}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:14,代码来源:adodb-firebird.inc.php

示例15: MetaTables

 function MetaTables($ttype = false, $showSchema = false, $mask = false)
 {
     $save = $this->metaTablesSQL;
     if ($showSchema && is_string($showSchema)) {
         $this->metaTablesSQL .= $this->qstr($showSchema);
     } else {
         $this->metaTablesSQL .= "schema()";
     }
     if ($mask) {
         $mask = $this->qstr($mask);
         $this->metaTablesSQL .= " AND table_name LIKE {$mask}";
     }
     $ret = ADOConnection::MetaTables($ttype, $showSchema);
     $this->metaTablesSQL = $save;
     return $ret;
 }
开发者ID:Cloudrexx,项目名称:cloudrexx,代码行数:16,代码来源:adodb-pdo_mysql.inc.php


注:本文中的ADOConnection类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。