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


PHP ibase_affected_rows函数代码示例

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


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

示例1: query

 function query($query, $unbuffered = false)
 {
     $result = ibase_query($query, $this->_link);
     if (!$result) {
         $this->errno = ibase_errcode();
         $this->error = ibase_errmsg();
         return false;
     }
     $this->error = "";
     if ($result === true) {
         $this->affected_rows = ibase_affected_rows($this->_link);
         return true;
     }
     return new Min_Result($result);
 }
开发者ID:tlandn,项目名称:akvo-sites-zz-template,代码行数:15,代码来源:firebird.inc.php

示例2: execute

 public function execute($sql, array $data = null)
 {
     $this->connect();
     if (!is_array($data)) {
         $data = array();
     }
     $data = array_values($data);
     foreach ($data as $i => $v) {
         switch (gettype($v)) {
             case 'boolean':
             case 'integer':
                 $data[$i] = (int) $v;
                 break;
             case 'array':
                 $data[$i] = implode(',', $v);
                 break;
             case 'object':
                 $data[$i] = serialize($data[$i]);
                 break;
             case 'resource':
                 if (is_resource($v) && get_resource_type($v) === 'stream') {
                     $data[$i] = stream_get_contents($data[$i]);
                 } else {
                     $data[$i] = serialize($data[$i]);
                 }
                 break;
         }
     }
     array_unshift($data, $sql);
     $temp = call_user_func_array("\\ibase_execute", $data);
     if (!$temp) {
         throw new DatabaseException('Could not execute query : ' . \ibase_errmsg() . ' <' . $sql . '>');
     }
     $this->aff = \ibase_affected_rows($this->lnk);
     return $temp;
 }
开发者ID:vakata,项目名称:database,代码行数:36,代码来源:Ibase.php

示例3: affectedRows

 /**
  * Retrieve number of affected rows for last query
  *
  * @return  int
  */
 protected function affectedRows()
 {
     return ibase_affected_rows($this->handle);
 }
开发者ID:Gamepay,项目名称:xp-framework,代码行数:9,代码来源:InterBaseConnection.class.php

示例4: affected_rows

 /**
  * Affected Rows
  *
  * @access	public
  * @return	integer
  */
 function affected_rows()
 {
     return @ibase_affected_rows($this->result_id);
 }
开发者ID:ibnoe,项目名称:simpatda-thinkfrogs,代码行数:10,代码来源:firebird_driver.php

示例5: query

 /**
  * Ejecuta un query sobre la conexion existente. Si se produce algun error
  * se puede consultar con getError().
  * @param string Sentencia sql
  * @return result
  */
 public function query($query)
 {
     $this->result = null;
     if ($_SESSION['VARIABLES']['EnvPro']['log'] === '1') {
         $fp = fopen($this->logQueryFile, "a");
         fwrite($fp, date("Y-m-d H:i:s") . "\t" . $query . "\n");
         fclose($fp);
     }
     switch (self::$dbEngine) {
         case 'mysql':
             //mysql_select_db($this->getdataBase());
             $this->result = mysql_query($query, self::$dbLinkInstance);
             if (!$this->result) {
                 $this->setError("query", $query);
             } else {
                 $this->affectedRows = mysql_affected_rows(self::$dbLinkInstance);
             }
             break;
         case 'mssql':
             //mssql_select_db($this->dataBase);
             $query = str_replace("`", "", $query);
             $this->result = mssql_query($query, self::$dbLinkInstance);
             if (!$this->result) {
                 $this->setError("query", $query);
             } else {
                 $this->affectedRows = mysql_affected_rows(self::$dbLinkInstance);
             }
             break;
         case 'interbase':
             $query = str_replace("`", "", $query);
             $this->result = ibase_query(self::$dbLinkInstance, $query);
             if (!$this->result) {
                 $this->setError("query", $query);
             } else {
                 $this->affectedRows = ibase_affected_rows(self::$dbLinkInstance);
             }
             break;
         case 'pgsql':
             $query = str_replace("`", "", $query);
             $this->result = pg_query(self::$dbLinkInstance, $query);
             if (!$this->result) {
                 $this->setError("query", $query);
             } else {
                 $this->affectedRows = pg_affected_rows(self::$dbLinkInstance);
             }
             break;
         default:
             $this->setError("query", "No se ha indicado el tipo de base de datos");
     }
     return $this->result;
 }
开发者ID:albatronic,项目名称:hermes,代码行数:57,代码来源:EntityManager.class.php

示例6: _performQuery

 function _performQuery($queryMain)
 {
     $this->_lastQuery = $queryMain;
     $this->_expandPlaceholders($queryMain, $this->DbSimple_Ibase_USE_NATIVE_PHOLDERS);
     $hash = $queryMain[0];
     if (!isset($this->prepareCache[$hash])) {
         $this->prepareCache[$hash] = @ibase_prepare(is_resource($this->trans) ? $this->trans : $this->link, $queryMain[0]);
     } else {
         // Prepare cache hit!
     }
     $prepared = $this->prepareCache[$hash];
     if (!$prepared) {
         return $this->_setDbError($queryMain[0]);
     }
     $queryMain[0] = $prepared;
     $result = @call_user_func_array('ibase_execute', $queryMain);
     // ATTENTION!!!
     // WE MUST save prepared ID (stored in $prepared variable) somewhere
     // before returning $result because of ibase destructor. Now it is done
     // by $this->prepareCache. When variable $prepared goes out of scope, it
     // is destroyed, and memory for result also freed by PHP. Totally we
     // got "Invalud statement handle" error message.
     if ($result === false) {
         return $this->_setDbError($queryMain[0]);
     }
     if (!is_resource($result)) {
         // Non-SELECT queries return number of affected rows, SELECT - resource.
         return @ibase_affected_rows(is_resource($this->trans) ? $this->trans : $this->link);
     }
     return $result;
 }
开发者ID:saqar,项目名称:tc_aowow,代码行数:31,代码来源:Ibase.php

示例7: affected_rows

 public function affected_rows()
 {
     return ibase_affected_rows($this->handler);
 }
开发者ID:Lazary,项目名称:webasyst,代码行数:4,代码来源:waDbIbaseAdapter.class.php

示例8: getAffectedRows

 /**
  * Gets the number of affected rows by the last INSERT, UPDATE or DELETE query.
  * @return int|FALSE  number of rows or FALSE on error
  */
 public function getAffectedRows()
 {
     return ibase_affected_rows($this->connection);
 }
开发者ID:floffel03,项目名称:pydio-core,代码行数:8,代码来源:DibiFirebirdDriver.php

示例9: execute

 /**
 +----------------------------------------------------------
 * 执行语句
 +----------------------------------------------------------
 * @access public
 +----------------------------------------------------------
 * @param string $str  sql指令
 +----------------------------------------------------------
 * @return integer
 +----------------------------------------------------------
 * @throws ThinkExecption
 +----------------------------------------------------------
 */
 public function execute($str)
 {
     $this->initConnect(true);
     if (!$this->_linkID) {
         return false;
     }
     $this->queryStr = $str;
     //释放前次的查询结果
     if ($this->queryID) {
         $this->free();
     }
     N('db_write', 1);
     // 记录开始执行时间
     G('queryStartTime');
     $result = ibase_query($this->_linkID, $str);
     $this->debug();
     if (false === $result) {
         $this->error();
         return false;
     } else {
         $this->numRows = ibase_affected_rows($this->_linkID);
         $this->lastInsID = 0;
         return $this->numRows;
     }
 }
开发者ID:dalinhuang,项目名称:concourse,代码行数:38,代码来源:DbIbase.class.php

示例10: query

 /**
  * Ejecuta un query sobre la conexion existente. Si se produce algun error
  * se puede consultar con getError().
  * @param string Sentencia sql
  * @return result
  */
 public function query($query)
 {
     $this->result = null;
     switch ($this->dbEngine) {
         case 'mysql':
             //mysql_select_db($this->getdataBase());
             $this->result = mysql_query($query, $this->dbLink);
             //$fp = fopen("log/queries.sql", "a");
             //fwrite($fp, date("Y-m-d H:i:s")."\t".$query."\n");
             //fclose($fp);
             if (!$this->result) {
                 $this->setError("query");
             } else {
                 $this->affectedRows = mysql_affected_rows($this->dbLink);
             }
             break;
         case 'mssql':
             //mssql_select_db($this->dataBase);
             $this->result = mssql_query($query, $this->dbLink);
             if (!$this->result) {
                 $this->setError("query");
             } else {
                 $this->affectedRows = mysql_affected_rows($this->dbLink);
             }
             break;
         case 'interbase':
             $query = str_replace("`", "", $query);
             $this->result = ibase_query($this->dbLink, $query);
             if (!$this->result) {
                 $this->setError("query");
             } else {
                 $this->affectedRows = ibase_affected_rows($this->dbLink);
             }
             break;
         default:
             $this->setError("query", "No se ha indicado el tipo de base de datos");
     }
     return $this->result;
 }
开发者ID:albatronic,项目名称:hermes,代码行数:45,代码来源:xxEntityManager.class.php

示例11: affectedRows

 public function affectedRows()
 {
     if (!empty($this->connect)) {
         return ibase_affected_rows($this->connect);
     } else {
         return false;
     }
 }
开发者ID:bytemtek,项目名称:znframework,代码行数:8,代码来源:Ibase.php

示例12: _performQuery

 function _performQuery($queryMain)
 {
     $this->_lastQuery = $queryMain;
     $this->_expandPlaceholders($queryMain, false);
     $result = ibase_query($this->link, $queryMain[0]);
     if ($result === false) {
         return $this->_setDbError($queryMain[0]);
     }
     if (!is_resource($result)) {
         // Non-SELECT queries return number of affected rows, SELECT - resource.
         return @ibase_affected_rows($this->link);
     }
     return $result;
 }
开发者ID:space77,项目名称:mwfv3_sp,代码行数:14,代码来源:Ibase.php

示例13: affectedRows

 /**
  * Renvoie le nombre de lignes affectées par la dernière requète DML
  * 
  * @access public
  * @return boolean
  */
 function affectedRows()
 {
     return ibase_affected_rows($this->link);
 }
开发者ID:bibwho,项目名称:MATPbootstrap,代码行数:10,代码来源:firebird.php

示例14: affectedRows

 /**
  * returns the affected rows of a query
  *
  * @return mixed MDB Error Object or number of rows
  * @access public
  */
 function affectedRows()
 {
     if (function_exists('ibase_affected_rows')) {
         //PHP5 only
         $affected_rows = @ibase_affected_rows($this->connection);
         if ($affected_rows === false) {
             return $this->raiseError(MDB_ERROR_NEED_MORE_DATA);
         }
         return $affected_rows;
     }
     return parent::affectedRows();
 }
开发者ID:Esleelkartea,项目名称:kz-adeada-talleres-electricos-,代码行数:18,代码来源:ibase.php

示例15: _execute

 /**
 +----------------------------------------------------------
 * 执行语句 针对 INSERT, UPDATE 以及DELETE
 +----------------------------------------------------------
 * @access protected 
 +----------------------------------------------------------
 * @param string $str  sql指令
 +----------------------------------------------------------
 * @return integer
 +----------------------------------------------------------
 * @throws ThinkExecption
 +----------------------------------------------------------
 */
 protected function _execute($str = '')
 {
     $this->initConnect(true);
     if (!$this->_linkID) {
         return false;
     }
     if ($str != '') {
         $this->queryStr = $str;
     }
     if (!$this->autoCommit && $this->isMainIps($this->queryStr)) {
         $this->startTrans();
     } else {
         //释放前次的查询结果
         if ($this->queryID) {
             $this->free();
         }
     }
     $this->writeTimes++;
     $this->W(1);
     $result = ibase_query($this->_linkID, $this->queryStr);
     $this->debug();
     if (false === $result) {
         return false;
     } else {
         $this->numRows = ibase_affected_rows($this->_linkID);
         //剑雷 2007.12.28
         //$this->lastInsID = mysql_insert_id($this->_linkID);
         $this->lastInsID = 0;
         return $this->numRows;
     }
 }
开发者ID:skiman100,项目名称:thinksns,代码行数:44,代码来源:DbIbase.class.php


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