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


PHP ADOConnection::GetOne方法代码示例

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


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

示例1: 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

示例2: ServerInfo

 function ServerInfo()
 {
     $arr['description'] = ADOConnection::GetOne("select version()");
     $arr['version'] = ADOConnection::_findvers($arr['description']);
     return $arr;
 }
开发者ID:jpbalderas17,项目名称:hris,代码行数:6,代码来源:adodb-pdo_pgsql.inc.php

示例3: GetOne

 function GetOne($sql, $inputarr = false)
 {
     global $ADODB_GETONE_EOF;
     if ($this->compat323 == false && strncasecmp($sql, 'sele', 4) == 0) {
         $rs = $this->SelectLimit($sql, 1, -1, $inputarr);
         if ($rs) {
             $rs->Close();
             if ($rs->EOF) {
                 return $ADODB_GETONE_EOF;
             }
             return reset($rs->fields);
         }
     } else {
         return ADOConnection::GetOne($sql, $inputarr);
     }
     return false;
 }
开发者ID:JonsonChang,项目名称:mail_tracker,代码行数:17,代码来源:adodb-mysql.inc.php

示例4: GetOne

 function GetOne($sql, $inputarr = false)
 {
     if (strncasecmp($sql, 'sele', 4) == 0) {
         $rs =& $this->SelectLimit($sql, 1, -1, $inputarr);
         if ($rs) {
             $rs->Close();
             if ($rs->EOF) {
                 return false;
             }
             return reset($rs->fields);
         }
     } else {
         return ADOConnection::GetOne($sql, $inputarr);
     }
     return false;
 }
开发者ID:BackupTheBerlios,项目名称:dilps,代码行数:16,代码来源:adodb-mysql.inc.php

示例5: _insertid

 function _insertid()
 {
     return ADOConnection::GetOne('VALUES IDENTITY_VAL_LOCAL()');
 }
开发者ID:rowlandm,项目名称:uiexperiment,代码行数:4,代码来源:adodb-db2.inc.php

示例6: getOne

 function getOne()
 {
     $this->limit(1);
     return $this->db->GetOne($this->__toString(), $this->params);
 }
开发者ID:hopitio,项目名称:framework,代码行数:5,代码来源:Mapper.php

示例7: _insertid

 function _insertid()
 {
     /*
      * mysqli_insert_id does not return the last_insert_id
      * if called after execution of a stored procedure
      * so we execute this instead.
      */
     return ADOConnection::GetOne('SELECT LAST_INSERT_ID()');
     $result = @mysqli_insert_id($this->_connectionID);
     if ($result == -1) {
         if ($this->debug) {
             ADOConnection::outp("mysqli_insert_id() failed : " . $this->ErrorMsg());
         }
     }
     return $result;
 }
开发者ID:SecMyth,项目名称:ADOdb,代码行数:16,代码来源:adodb-mysqli.inc.php

示例8: _insertid

 function _insertid()
 {
     /*
      * mysqli_insert_id does not return the last_insert_id
      * if called after execution of a stored procedure
      * so we execute this instead.
      */
     $result = false;
     if ($this->useLastInsertStatement) {
         $result = ADOConnection::GetOne('SELECT LAST_INSERT_ID()');
     } else {
         $result = @mysqli_insert_id($this->_connectionID);
     }
     if ($result == -1) {
         if ($this->debug) {
             ADOConnection::outp("mysqli_insert_id() failed : " . $this->ErrorMsg());
         }
     }
     /*
      * reset prepared statement flags
      */
     $this->usePreparedStatement = false;
     $this->useLastInsertStatement = false;
     return $result;
 }
开发者ID:yrsdi,项目名称:ADOdb,代码行数:25,代码来源:adodb-mysqli.inc.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::GetOne方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。