1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-07 14:46:50 +02:00

* removed variables $insertId & $affectedRows

This commit is contained in:
David Grudl
2007-08-28 22:13:53 +00:00
parent 0ff0cd21df
commit 6f4d2c545d
8 changed files with 115 additions and 103 deletions

View File

@@ -22,9 +22,6 @@ if (!class_exists('dibi', FALSE)) die();
*/
class DibiMSSqlDriver extends DibiDriver
{
private
$affectedRows = FALSE;
public
$formats = array(
'TRUE' => "1",
@@ -78,27 +75,25 @@ class DibiMSSqlDriver extends DibiDriver
public function nativeQuery($sql)
{
$this->affectedRows = FALSE;
$connection = $this->getConnection();
$res = @mssql_query($sql, $connection);
$res = @mssql_query($sql, $this->getConnection());
if ($res === FALSE) return FALSE;
if ($res === FALSE) {
return FALSE;
$this->affectedRows = mssql_rows_affected($connection);
if ($this->affectedRows < 0) $this->affectedRows = FALSE;
if (is_resource($res)) {
} elseif (is_resource($res)) {
return new DibiMSSqlResult($res);
}
return TRUE;
} else {
return TRUE;
}
}
public function affectedRows()
{
return $this->affectedRows;
$rows = mssql_rows_affected($this->getConnection());
return $rows < 0 ? FALSE : $rows;
}