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


PHP db2_num_rows函数代码示例

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


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

示例1: rowCount

 /**
  * 
  * @return integer number of rows updated
  */
 public function rowCount()
 {
     if (!$this->_stmt) {
         return false;
     }
     $num = db2_num_rows($this->_stmt);
     if ($num === false) {
         throw new Zend_Db_Statement_Db2_Exception(db2_stmt_errormsg($this->_stmt), db2_stmt_error($this->_stmt));
     }
     return db2_num_rows($this->_stmt);
 }
开发者ID:BackupTheBerlios,项目名称:openpublisher-svn,代码行数:15,代码来源:Db2.php

示例2: insert

 function insert()
 {
     $conn = $this->connect();
     if ($conn == true) {
         $sql = "SELECT name from helloworld";
         $stmt = db2_exec($conn, $sql);
         $num_rows = db2_num_rows($stmt);
         if ($num_rows == 0 || $num_rows == "") {
             $sql = "INSERT INTO helloworld(NAME) VALUES ('Hello World')";
             $stmt = db2_exec($conn, $sql);
         }
     }
 }
开发者ID:ab-k,项目名称:phresco,代码行数:13,代码来源:db2.php

示例3: _initrs

 function _initrs()
 {
     global $ADODB_COUNTRECS;
     $this->_numOfRows = $ADODB_COUNTRECS ? @db2_num_rows($this->_queryID) : -1;
     $this->_numOfFields = @db2_num_fields($this->_queryID);
     // some silly drivers such as db2 as/400 and intersystems cache return _numOfRows = 0
     if ($this->_numOfRows == 0) {
         $this->_numOfRows = -1;
     }
 }
开发者ID:rowlandm,项目名称:uiexperiment,代码行数:10,代码来源:adodb-db2.inc.php

示例4: lastNumRows

 /**
  * Returns number of rows in previous resultset. If no previous resultset exists,
  * this returns false.
  *
  * @return integer Number of rows in resultset
  */
 function lastNumRows()
 {
     if ($this->_result) {
         return db2_num_rows($this->_result);
     }
     return null;
 }
开发者ID:christianallred,项目名称:fluent_univ,代码行数:13,代码来源:dbo_db2.php

示例5: affectedRows

 /**
  * Returns the number of rows affected by the last query or 0
  * @return Integer: the number of rows affected by the last query
  */
 public function affectedRows()
 {
     if (!is_null($this->mAffectedRows)) {
         // Forced result for simulated queries
         return $this->mAffectedRows;
     }
     if (empty($this->mLastResult)) {
         return 0;
     }
     return db2_num_rows($this->mLastResult);
 }
开发者ID:nischayn22,项目名称:mediawiki-core,代码行数:15,代码来源:DatabaseIbm_db2.php

示例6: getAffectedRows

 /**
  * Get affected rows
  *
  * @return integer
  */
 public function getAffectedRows()
 {
     return db2_num_rows($this->resource);
 }
开发者ID:totolouis,项目名称:ZF2-Auth,代码行数:9,代码来源:Result.php

示例7: dbi_affected_rows

function dbi_affected_rows($conn, $res)
{
    if (strcmp($GLOBALS['db_type'], 'mysql') == 0) {
        return mysql_affected_rows($conn);
    } elseif (strcmp($GLOBALS['db_type'], 'mysqli') == 0) {
        return $conn->affected_rows;
    } elseif (strcmp($GLOBALS['db_type'], 'mssql') == 0) {
        return mssql_rows_affected($conn);
    } elseif (strcmp($GLOBALS['db_type'], 'oracle') == 0) {
        return $GLOBALS['oracle_statement'] >= 0 ? OCIRowCount($GLOBALS['oracle_statement']) : -1;
    } elseif (strcmp($GLOBALS['db_type'], 'postgresql') == 0) {
        return pg_affected_rows($res);
    } elseif (strcmp($GLOBALS['db_type'], 'odbc') == 0) {
        return odbc_num_rows($res);
    } elseif (strcmp($GLOBALS['db_type'], 'ibm_db2') == 0) {
        return db2_num_rows($res);
    } elseif (strcmp($GLOBALS['db_type'], 'ibase') == 0) {
        return ibase_affected_rows($conn);
    } elseif (strcmp($GLOBALS['db_type'], 'sqlite') == 0) {
        return sqlite_changes($conn);
    } else {
        dbi_fatal_error('dbi_free_result (): ' . translate('db_type not defined.'));
    }
}
开发者ID:rhertzog,项目名称:lcs,代码行数:24,代码来源:dbi4php.php

示例8: dbi_affected_rows

/**
 * Returns the number of rows affected by the last INSERT, UPDATE or DELETE.
 *
 * <b>Note:</b> Use the {@link dbi_error()} function to get error information
 * if the connection fails.
 *
 * @param resource $conn The database connection
 * @param resource $res  The database query resource returned from
 *                       the {@link dbi_query()} function.
 *
 * @return int The number or database rows affected.
 */
function dbi_affected_rows($conn, $res)
{
    if (strcmp($GLOBALS["db_type"], "mysql") == 0) {
        return mysql_affected_rows($conn);
    } else {
        if (strcmp($GLOBALS["db_type"], "mysqli") == 0) {
            return mysqli_affected_rows($conn);
        } else {
            if (strcmp($GLOBALS["db_type"], "mssql") == 0) {
                return mssql_affected_rows($conn);
            } else {
                if (strcmp($GLOBALS["db_type"], "oracle") == 0) {
                    if ($GLOBALS["oracle_statement"] >= 0) {
                        return OCIRowCount($GLOBALS["oracle_statement"]);
                    } else {
                        return -1;
                    }
                } else {
                    if (strcmp($GLOBALS["db_type"], "postgresql") == 0) {
                        return pg_affected_rows($res);
                    } else {
                        if (strcmp($GLOBALS["db_type"], "odbc") == 0) {
                            return odbc_num_rows($res);
                        } else {
                            if (strcmp($GLOBALS["db_type"], "ibm_db2") == 0) {
                                return db2_num_rows($res);
                            } else {
                                if (strcmp($GLOBALS["db_type"], "ibase") == 0) {
                                    return ibase_affected_rows($conn);
                                } else {
                                    dbi_fatal_error("dbi_free_result(): db_type not defined.");
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
开发者ID:neymanna,项目名称:fusionforge,代码行数:52,代码来源:php-dbi.php

示例9: lastNumRows

 /**
  * {@inheritdoc}
  */
 public function lastNumRows()
 {
     return $this->result ? db2_num_rows($this->result) : false;
 }
开发者ID:speedwork,项目名称:database,代码行数:7,代码来源:Db2Driver.php

示例10: execute

 public function execute($bind_params = false)
 {
     $ret_val = false;
     //----------------------------------------------
     // Check Statement Resource
     //----------------------------------------------
     if (!$this->stmt) {
         $this->gen_error('Invalid statement resource.');
         return false;
     }
     //----------------------------------------------
     // Check Bind Parameters
     //----------------------------------------------
     if (!is_array($bind_params)) {
         $this->gen_error('Binding parameters must be passed as an array.');
         return false;
     }
     $this->bind_params = $bind_params;
     //----------------------------------------------
     // Execute Query
     //----------------------------------------------
     $exec_status = @db2_execute($this->stmt, $bind_params);
     //----------------------------------------------
     // Check for Errors
     //----------------------------------------------
     if (!$exec_status) {
         if ($this->check_and_print_stmt_error($this->stmt)) {
             return false;
         }
         $this->gen_error('Prepared query execution failed.');
         return false;
     }
     //----------------------------------------------
     // Create Data Result Object if Necessary
     //----------------------------------------------
     if ($this->stmt && gettype($this->stmt) != 'boolean') {
         //----------------------------------------------
         // Affected Rows
         //----------------------------------------------
         $this->affected_rows = db2_num_rows($this->stmt);
         $ret_val = $this->affected_rows;
         //----------------------------------------------
         // Create Data Result Object
         //----------------------------------------------
         $this->data_result = new data_result($this->stmt, $this->data_src);
         //----------------------------------------------
         // Last Insert ID
         //----------------------------------------------
         $this->last_id = db2_last_insert_id($this->handle);
     }
     //----------------------------------------------
     // Return Data Result Object if it exists
     //----------------------------------------------
     if ($this->data_result) {
         $this->num_rows = $this->data_result->num_rows();
         $this->num_fields = $this->data_result->num_fields();
         $ret_val = $this->data_result;
     }
     //----------------------------------------------
     // Check for Errors
     //----------------------------------------------
     if ($this->check_and_print_stmt_error($this->stmt)) {
         return false;
     }
     return $ret_val;
 }
开发者ID:codifyllc,项目名称:phpopenfw,代码行数:66,代码来源:dt_db2.class.php

示例11: rowCount

 /**
  * {@inheritdoc}
  */
 public function rowCount()
 {
     return (int) @db2_num_rows($this->_stmt);
 }
开发者ID:nicolas-grekas,项目名称:Patchwork-Doctrine,代码行数:7,代码来源:DB2Statement.php

示例12: set_num_rows

 public function set_num_rows()
 {
     $this->num_recs = db2_num_rows($this->resource);
 }
开发者ID:codifyllc,项目名称:phpopenfw,代码行数:4,代码来源:dr_db2.class.php

示例13: getAffectedRows

 /**
  * Get number of rows affected by query
  *
  * @return  int
  */
 public function getAffectedRows()
 {
     switch ($this->model) {
         case "MYSQLI":
             $return = $this->handler->affected_rows;
             break;
         case "MYSQL_PDO":
         case "SQLITE_PDO":
         case "ORACLE_PDO":
         case "DBLIB_PDO":
             $return = $this->raw_data->rowCount();
             break;
         case "DB2":
             $return = db2_num_rows($this->raw_data);
             break;
         case "POSTGRESQL":
             $return = pg_affected_rows($this->raw_data);
             break;
     }
     return $return;
 }
开发者ID:comodojo,项目名称:database,代码行数:26,代码来源:QueryResult.php

示例14: rowCount

 /**
  * {@inheritdoc}
  */
 public function rowCount()
 {
     return @db2_num_rows($this->_stmt) ?: 0;
 }
开发者ID:ashimidashajia,项目名称:zendstore,代码行数:7,代码来源:DB2Statement.php

示例15: numRows

 /**
  * Number of rows in a result
  *
  * @param   mixed $result
  * @return  integer
  * @access  public
  * @author  Thorsten Rinne <thorsten@phpmyfaq.de>
  * @since   2005-04-16
  */
 function numRows($result)
 {
     return db2_num_rows($result);
 }
开发者ID:nosch,项目名称:phpMyFAQ,代码行数:13,代码来源:Ibm_db2.php


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