本文整理汇总了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);
}
示例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;
}
示例3: affectedRows
/**
* Retrieve number of affected rows for last query
*
* @return int
*/
protected function affectedRows()
{
return ibase_affected_rows($this->handle);
}
示例4: affected_rows
/**
* Affected Rows
*
* @access public
* @return integer
*/
function affected_rows()
{
return @ibase_affected_rows($this->result_id);
}
示例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;
}
示例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;
}
示例7: affected_rows
public function affected_rows()
{
return ibase_affected_rows($this->handler);
}
示例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);
}
示例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;
}
}
示例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;
}
示例11: affectedRows
public function affectedRows()
{
if (!empty($this->connect)) {
return ibase_affected_rows($this->connect);
} else {
return false;
}
}
示例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;
}
示例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);
}
示例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();
}
示例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;
}
}