本文整理汇总了PHP中sybase_affected_rows函数的典型用法代码示例。如果您正苦于以下问题:PHP sybase_affected_rows函数的具体用法?PHP sybase_affected_rows怎么用?PHP sybase_affected_rows使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sybase_affected_rows函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: exec
public function exec(&$statement)
{
if ($result = @sybase_query($statement, $this->link)) {
if (is_resource($result)) {
sybase_free_result($result);
return 0;
}
return sybase_affected_rows($this->link);
}
return false;
}
示例2: affectedRows
/**
* Determines the number of rows affected by a data maniuplation query
*
* 0 is returned for queries that don't manipulate data.
*
* @return int the number of rows. A DB_Error object on failure.
*/
function affectedRows()
{
if (DB::isManip($this->last_query)) {
$result = @sybase_affected_rows($this->connection);
} else {
$result = 0;
}
return $result;
}
示例3: lastAffected
/**
* Returns number of affected rows in previous database operation. If no previous operation exists,
* this returns false.
*
* @return integer Number of affected rows
*/
function lastAffected()
{
if ($this->_result) {
return sybase_affected_rows($this->connection);
}
return null;
}
示例4: rowCount
public function rowCount()
{
return sybase_affected_rows($this->_link);
}
示例5: affectedRows
/**
* Determines the number of rows affected by a data maniuplation query
*
* 0 is returned for queries that don't manipulate data.
*
* @return int the number of rows. A DB_Error object on failure.
*/
function affectedRows()
{
if ($this->_last_query_manip) {
$result = @sybase_affected_rows($this->connection);
} else {
$result = 0;
}
return $result;
}
示例6: affected_rows
/**
* Affected Rows
*
* @access public
* @return integer
*/
function affected_rows()
{
return @sybase_affected_rows($this->conn_id);
}
示例7: affectedRows
/**
* Retrieve number of affected rows for last query
*
* @return int
*/
protected function affectedRows()
{
return sybase_affected_rows($this->handle);
}
示例8: affected_rows
/**
* Return the number of affected rows
* @return integer
*/
protected function affected_rows()
{
return @sybase_affected_rows();
}
示例9: affected_rows
function affected_rows()
{
return sybase_affected_rows($this->Query_ID);
}
示例10: query0
/**
* Execute any statement
*
* @param string sql
* @param bool buffered default TRUE
* @return rdbms.ResultSet
* @throws rdbms.SQLException
*/
protected function query0($sql, $buffered = true)
{
if (!is_resource($this->handle)) {
if (!($this->flags & DB_AUTOCONNECT)) {
throw new \rdbms\SQLStateException('Not connected');
}
$c = $this->connect();
// Check for subsequent connection errors
if (false === $c) {
throw new \rdbms\SQLStateException('Previously failed to connect');
}
}
if (!$buffered) {
$result = @sybase_unbuffered_query($sql, $this->handle, false);
} else {
if ($this->flags & DB_UNBUFFERED) {
$result = @sybase_unbuffered_query($sql, $this->handle, $this->flags & DB_STORE_RESULT);
} else {
$result = @sybase_query($sql, $this->handle);
}
}
if (false === $result) {
$message = 'Statement failed: ' . trim(sybase_get_last_message()) . ' @ ' . $this->dsn->getHost();
if (!is_resource($error = sybase_query('select @@error', $this->handle))) {
// The only case selecting @@error should fail is if we receive a
// disconnect. We could also check on the warnings stack if we can
// find the following:
//
// Sybase: Client message: Read from SQL server failed. (severity 78)
//
// but that seems a bit errorprone.
throw new \rdbms\SQLConnectionClosedException($message, $sql);
}
$code = current(sybase_fetch_row($error));
switch ($code) {
case 1205:
// Deadlock
throw new \rdbms\SQLDeadlockException($message, $sql, $code);
default:
// Other error
throw new \rdbms\SQLStatementFailedException($message, $sql, $code);
}
} else {
if (true === $result) {
return new QuerySucceeded(sybase_affected_rows($this->handle));
} else {
return new SybaseResultSet($result, $this->tz);
}
}
}
示例11: affectedRows
public function affectedRows()
{
if (!empty($this->connect)) {
return sybase_affected_rows($this->connect);
} else {
return false;
}
}
示例12: _performQuery
function _performQuery($queryMain)
{
$this->_lastQuery = $queryMain;
$this->_expandPlaceholders($queryMain, false);
// Convert query if allow on fly encodings
if ($this->lcharset && $this->rcharset) {
$sql_query = mb_convert_encoding($queryMain[0], $this->rcharset, $this->lcharset);
} else {
$sql_query = $queryMain[0];
}
$result = sybase_query($sql_query, $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 = sybase_fetch_assoc(sybase_query("SELECT @@identity insert_id", $this->link));
return isset($result['insert_id']) ? $result['insert_id'] : true;
}
// Non-SELECT queries return number of affected rows, SELECT - resource.
return sybase_affected_rows($this->link);
}
return $result;
}