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


PHP ADOConnection::Execute方法代码示例

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


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

示例1: setup

 function setup()
 {
     if ($this->isType('mysql')) {
         if ($this->getCreateTarget() == true) {
             $this->connection =& NewADOConnection($this->dbConfig->getDBType());
             $ok = $this->connection->NConnect($this->dbConfig->getHostName(), $this->dbConfig->getRootUserName(), $this->dbConfig->getRootPassword());
             if (!$ok) {
                 throw new DatabaseBackupException(DatabaseBackupErrorCode::$DB_CONNECT_ERROR, DatabaseBackup::$langString['DestConnectFailed']);
             }
             // Drop database if already exists
             $sql = "drop database IF EXISTS " . $this->dbConfig->getDatabaseName();
             $result = $this->connection->Execute($sql);
             $this->checkError($result, $sql);
             $sql = 'create database ' . $this->dbConfig->getDatabaseName();
             if ($this->supportUTF8 == true) {
                 $sql .= " default character set utf8 default collate utf8_general_ci";
             }
             $result = $this->connection->Execute($sql);
             $this->checkError($result, $sql);
             $this->connection->Close();
         }
         $this->connection =& NewADOConnection($this->dbConfig->getDBType());
         $ok = $this->connection->NConnect($this->dbConfig->getHostName(), $this->dbConfig->getUserName(), $this->dbConfig->getPassword(), $this->dbConfig->getDatabaseName());
         if (!$ok) {
             throw new DatabaseBackupException(DatabaseBackupErrorCode::$DB_CONNECT_ERROR, DatabaseBackup::$langString['DestConnectFailed']);
         }
         $result = $this->connection->_Execute("SET interactive_timeout=28800", false);
         $result = $this->connection->_Execute("SET wait_timeout=28800", false);
         $result = $this->connection->_Execute("SET net_write_timeout=900", false);
     }
 }
开发者ID:casati-dolibarr,项目名称:corebos,代码行数:31,代码来源:Database.php

示例2: removeRight

 /**
  * Remove right
  *
  * @param array $params
  * @return void
  */
 public function removeRight(array $params)
 {
     $rightId = (int) $params['right_id'];
     // get permission
     $sql = 'SELECT right_define_name
             FROM ' . self::RIGHTS . "\n                WHERE right_id = {$rightId}";
     $permission = $this->db->GetOne($sql);
     // remove acl rules
     try {
         list($resource, ) = PermissionToAcl::translate($permission);
     } catch (\InvalidArgumentException $e) {
         return;
     }
     $sql = 'DELETE
             FROM ' . self::RULES . "\n                WHERE resource = '{$resource}'";
     $this->db->Execute($sql);
     // remove right
     $sql = 'DELETE
             FROM ' . self::RIGHTS . "\n                WHERE right_id = {$rightId}";
     $this->db->Execute($sql);
 }
开发者ID:sourcefabric,项目名称:newscoop,代码行数:27,代码来源:LiveUserMock.php

示例3: Execute

 function Execute($sql, $inputarr = false)
 {
     return ADOConnection::Execute($sql, $inputarr);
 }
开发者ID:HaakonME,项目名称:porticoestate,代码行数:4,代码来源:adodb-oci8po.inc.php

示例4: Execute

 function Execute($sql, $inputarr = false)
 {
     if ($this->is_utf) {
         $sql = preg_replace('/(\'.*\')/', 'N$1', $sql);
     }
     return parent::Execute($sql, $inputarr);
 }
开发者ID:benvanstaveren,项目名称:movabletype,代码行数:7,代码来源:adodb-mssqlnative.inc.php

示例5: autoIncrement

 public function autoIncrement($sec)
 {
     $res = $this->db->Execute('SELECT :sec nextval FROM dual commit', array("sec" => $sec));
     return $res->_array[0]['NEXTVAL'];
 }
开发者ID:juyagu,项目名称:Analia,代码行数:5,代码来源:GenericDAO.php

示例6: connect

 /**
  * Create DB connection
  */
 protected function connect()
 {
     /** @var $this->connection \ADOConnection */
     $this->connection =& NewADOConnection($this->driver);
     $host = $this->host;
     if ($this->port) {
         $host .= ':' . $this->port;
     }
     // connect
     if ($this->db) {
         $this->connection->Connect($host, $this->user, $this->password, $this->db);
     } else {
         $this->connection->Connect($host, $this->user, $this->password);
     }
     // check connection
     if (!$this->connection->IsConnected()) {
         $errMsg = $this->connection->ErrorMsg();
         $this->utilityFuncs->throwException('db_connection_failed', $errMsg);
     }
     // execute initial statement
     if ($this->setDBinit) {
         $this->utilityFuncs->debugMessage('sql_request', [$this->setDBinit]);
         $this->connection->Execute($this->setDBinit);
         // error occured?
         if ($this->connection->ErrorNo() != 0) {
             $errMsg = $this->connection->ErrorMsg();
             $this->utilityFuncs->debugMessage('sql_request_error', [$errMsg], 3);
         }
     }
 }
开发者ID:reinhardfuehricht,项目名称:typo3-formhandler,代码行数:33,代码来源:DifferentDB.php

示例7: CreateLogInfo

 function CreateLogInfo($good_id, $is_auto = 1, $myinfo = '')
 {
     $query = "insert into loginfo(created, good_id, source, loginfo, ip)\n         values(now(), " . intval($good_id) . ", " . intval($is_auto) . ", '" . $this->ProtectString($myinfo) . "', '" . $_SERVER['REMOTE_ADDR'] . "')\n        ";
     $this->_main_conn->Execute($query);
 }
开发者ID:parxomchik,项目名称:Agro,代码行数:5,代码来源:XFramework.class.php

示例8: getSpecialFieldsQueryPart

 /**
  * Get the string to select, insert, update or compare special fields
  * without a leading or trailing decimal point
  *
  * In case of comparison the chaining operator will be added in front of
  * every special field
  * @param \ADOConnection    $dbCon              The database connection
  * @param array             $data               The data to insert or
  *                                              update the entry
  * @param string            $comparator         Relational operator
  *                                              i.e. LIKE
  * @param string            $compareValue       Value to use with relational
  *                                              operator
  * @param string            $chainingOperator   Operator to chain
  *                                              comparisons i.e. OR
  * @return string
  */
 protected function getSpecialFieldsQueryPart($dbCon, $data = null, $comparator = '', $compareValue = '', $chainingOperator = ',')
 {
     $specialFields = array();
     // get amount of special fields
     $specialFieldCount = count($this->specialFields);
     if (empty($specialFieldCount)) {
         $specialFieldCount = $dbCon->Execute("SELECT COUNT(*) AS `count` FROM `" . DBPREFIX . "module_market_spez_fields` WHERE `lang_id` = 1");
         $specialFieldCount = $specialFieldCount->fields['count'];
     }
     for ($i = 1; $i <= $specialFieldCount; ++$i) {
         $value = '';
         // Data needs to  be updated or inserted
         if (!empty($data)) {
             $value = '=\'' . contrexx_input2db($data['spez_' . $i]) . '\'';
         }
         // Special fields are used in WHERE or similar comparison statements
         if (empty($data) && !empty($comparator) && !empty($compareValue)) {
             $value = ' ' . $comparator . ' ' . $compareValue;
         }
         $specialFields[] = 'spez_field_' . $i . $value;
     }
     $specialFields = join(' ' . $chainingOperator . ' ', $specialFields);
     return $specialFields;
 }
开发者ID:Cloudrexx,项目名称:cloudrexx,代码行数:41,代码来源:MarketLibrary.class.php

示例9: setOraclePassword

 /**
  * Set the Oracle password for a user, if they have an Oracle account. Since we cannot
  * use variable binding, validate the username and password before we pass them to
  * the script
  *
  * @param       $database \b ADOConnection an adodb connection
  * @param       $username \b string username
  * @param       $password \b string the new password
  */
 public static function setOraclePassword(ADOConnection $database, $username, $password)
 {
     $username = strtoupper($username);
     // do not proceed if user does not have an account in this database
     if (!$database->GetOne("SELECT 1 FROM dba_users WHERE username = :u", array('u' => $username))) {
         return false;
     }
     if (!self::validateOraclePassword($password)) {
         throw new Exception('Invalid password');
     }
     if (!self::validateOracleUsername($username)) {
         throw new Exception('Invalid username');
     }
     $password = str_replace('"', '\\"', $password);
     $database->Execute("ALTER USER {$username} IDENTIFIED BY \"{$password}\"");
     if ($database->ErrorNo() > 0) {
         throw new Exception("Database error:" . $database->ErrorMsg());
     }
     return true;
 }
开发者ID:AholibamaSI,项目名称:plymouth-webapp,代码行数:29,代码来源:PasswordManager.class.php


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