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


PHP mssql_affected_rows函数代码示例

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


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

示例1: __get

 public function __get($strName)
 {
     switch ($strName) {
         case 'AffectedRows':
             return mssql_affected_rows($this->objMsSql);
         default:
             try {
                 return parent::__get($strName);
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
     }
 }
开发者ID:snowmann,项目名称:qcodo,代码行数:14,代码来源:QSqlServerDatabase.class.php

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

示例3: getAffectedRows

 /**
  * @return int The number of affected rows in the previous operation
  * @since 1.0.5
  */
 function getAffectedRows()
 {
     return mssql_affected_rows($this->_resource);
 }
开发者ID:Jonathonbyrd,项目名称:SportsCapping-Experts,代码行数:8,代码来源:mssql.php

示例4: html_clean

                                 $b1 .= '<td nowrap>' . html_clean($inside) . '&nbsp;</td>';
                             }
                             $where = base64_encode($where);
                             if ($allowedit) {
                                 p('<td nowrap><a href="javascript:editrecord(\'edit\', \'' . $where . '\', \'' . $tablename . '\');">Edit</a> | <a href="javascript:editrecord(\'del\', \'' . $where . '\', \'' . $tablename . '\');">Del</a></td>');
                             }
                             p($b1);
                             p('</tr>');
                             $index++;
                             unset($b1);
                         }
                         tbfoot();
                         p($multipage);
                         break;
                     case 2:
                         $ar = mssql_affected_rows();
                         p('<h2>affected rows : <b>' . $ar . '</b></h2>');
                         break;
                 }
             }
         }
     }
 } else {
     $query = msq("select sysobjects.id,sysobjects.name,sysobjects.category,sysusers.name as owner,sysobjects.crdate from sysobjects join sysusers on sysobjects.uid = sysusers.uid where sysobjects.xtype = 'U' order by sysobjects.name asc");
     $table_num = 0;
     $tabledb = array();
     while ($table = mssql_fetch_array($query)) {
         $table_num++;
         $tabledb[] = $table;
     }
     unset($table);
开发者ID:mcanv,项目名称:webshell,代码行数:31,代码来源:2009mssql.php

示例5: affected_rows

 function affected_rows()
 {
     switch ($this->db) {
         case 'MySQL':
             return @mysql_affected_rows($this->res);
             break;
         case 'MSSQL':
             return @mssql_affected_rows($this->res);
             break;
         case 'PostgreSQL':
             return @pg_affected_rows($this->res);
             break;
         case 'Oracle':
             return @ocirowcount($this->res);
             break;
         default:
             return 0;
             break;
     }
 }
开发者ID:retanoj,项目名称:webshellSample,代码行数:20,代码来源:8445e897bf06d4ebcbdbeffb147bfab0.php

示例6: affected_rows

 /**
  * Número de Filas afectadas en un insert, update o delete
  *
  * @param resource $result_query
  * @return int
  */
 public function affected_rows($result_query = '')
 {
     if (($numberRows = mssql_affected_rows()) !== false) {
         return $numberRows;
     } else {
         $this->lastError = $this->error();
         throw new KumbiaException($this->error());
     }
     return false;
 }
开发者ID:jaigjaig,项目名称:usuario_auth_template_bootstrap,代码行数:16,代码来源:mssql.php

示例7: affectedRows

 /**
  * returns the affected rows of a query
  *
  * @return mixed MDB2 Error Object or number of rows
  * @access public
  */
 function affectedRows()
 {
     $affected_rows = @mssql_affected_rows($this->connection);
     if ($affected_rows === false) {
         return $this->raiseError(MDB2_ERROR_NEED_MORE_DATA);
     }
     return $affected_rows;
 }
开发者ID:GeekyNinja,项目名称:LifesavingCAD,代码行数:14,代码来源:mssql.php

示例8: insert_update

 public function insert_update($table, $data, $condition)
 {
     # Params:
     # 		$table = the name of the table
     # 		$data = field/value pairs to be added/updated
     # 		$condition = example: where id = 99
     if ($table) {
         if ($data) {
             if ($condition) {
                 if ($this->row_exists("select * from {$table} where {$condition}")) {
                     $this->result = mssql_query("update {$table} set {$data} where {$condition}") or $this->setError(mssql_error(), mssql_errno());
                     $this->query = "update {$table} set {$data} where {$condition}";
                     if ($this->result) {
                         $this->affected = intval(mssql_affected_rows());
                         // return the number of rows affected
                         return $this->affected;
                     }
                 } else {
                     $this->result = mssql_query("insert into {$table} set {$data}") or $this->setError(mssql_error(), mssql_errno());
                     $this->query = "insert into {$table} set {$data}";
                     if ($this->result) {
                         $this->insert_id = intval(mssql_insert_id());
                         $this->affected = intval(mssql_affected_rows());
                         // return the number of rows affected
                         return $this->affected;
                     }
                 }
             } else {
                 print "No Condition Specified !!";
             }
         } else {
             print "No Data Specified !!";
         }
     } else {
         print "No Table Specified !!";
     }
 }
开发者ID:juliushermosura,项目名称:globeloop,代码行数:37,代码来源:class_database.php

示例9: _performQuery

 function _performQuery($queryMain)
 {
     $this->_lastQuery = $queryMain;
     $this->_expandPlaceholders($queryMain, false);
     $result = mssql_query($queryMain[0], $this->link);
     if ($result === false) {
         return $this->_setDbError($queryMain[0]);
     }
     if (!is_resource($result)) {
         if (preg_match('/^\\s* INSERT \\s+/six', $queryMain[0])) {
             // INSERT queries return generated ID.
             $result = mssql_fetch_assoc(mssql_query("SELECT SCOPE_IDENTITY() AS insert_id", $this->link));
             return isset($result['insert_id']) ? $result['insert_id'] : true;
         }
         // Non-SELECT queries return number of affected rows, SELECT - resource.
         if (function_exists('mssql_affected_rows')) {
             return mssql_affected_rows($this->link);
         } elseif (function_exists('mssql_rows_affected')) {
             return mssql_rows_affected($this->link);
         }
     }
     return $result;
 }
开发者ID:Ambalus,项目名称:DbSimple,代码行数:23,代码来源:Mssql.php

示例10: execute_mssql

 private function execute_mssql($sSQL)
 {
     //Cuando se recupera un objeto desde sesion no cuenta
     //con linkid (linkid = 0)
     if (empty($this->_oLinkId)) {
         $this->conectar();
     }
     try {
         $oResource = mysql_query($sSQL, $this->_oLinkId);
         if ($oResource != false) {
             $this->_iRowsAffected = mssql_affected_rows();
             //mssql_free_result($oResource);
             $this->_isError = false;
             $this->_sMensaje = "executed: {$sSQL}";
             return true;
         } else {
             $this->_isError = true;
             $this->_sMensaje = "ERROR EN SQL: {$sSQL}";
             return -1;
         }
     } catch (Exception $e) {
         $sMensaje = "Excepción: " . $e->getMessage();
         $sMensaje .= "\nSQL = {$sSQL}";
         $this->_isError = true;
         $this->_sMensaje = $sMensaje;
         return -1;
     }
 }
开发者ID:eacevedof,项目名称:prj_anytest,代码行数:28,代码来源:boot_component_base_datos.php

示例11: affected_rows

 function affected_rows()
 {
     return mssql_affected_rows($this->Query_ID);
 }
开发者ID:hardikk,项目名称:HNH,代码行数:4,代码来源:phplib_mssql.php

示例12: NumAffected

 /**
  * NumAffected
  *
  * Returns the number of affected rows on success.
  *
  * @param  mixed $null Placeholder for postgres compatability
  *
  * @return int
  */
 function NumAffected($null)
 {
     return mssql_affected_rows($this->connection);
 }
开发者ID:nirvana-info,项目名称:old_bak,代码行数:13,代码来源:mssql.php

示例13: affectedRows

 public function affectedRows()
 {
     return @mssql_affected_rows($this->connection);
 }
开发者ID:mustafakarali,项目名称:orchidframework,代码行数:4,代码来源:mssqldriver.php


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