1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-12 00:54:11 +02:00

- added DibiVariable (experimental)

- fixed bug in DibiPostgreDriver::insertId()
This commit is contained in:
David Grudl
2007-11-22 10:35:23 +00:00
parent 981a1adaad
commit 3f42b2cf55
9 changed files with 75 additions and 25 deletions

View File

@@ -265,6 +265,7 @@ class DibiMsSqlDriver extends NObject implements DibiDriverInterface
public function free()
{
mssql_free_result($this->resultset);
$this->resultset = NULL;
}

View File

@@ -310,6 +310,7 @@ class DibiMySqlDriver extends NObject implements DibiDriverInterface
public function free()
{
mysql_free_result($this->resultset);
$this->resultset = NULL;
}

View File

@@ -297,6 +297,7 @@ class DibiMySqliDriver extends NObject implements DibiDriverInterface
public function free()
{
mysqli_free_result($this->resultset);
$this->resultset = NULL;
}

View File

@@ -279,6 +279,7 @@ class DibiOdbcDriver extends NObject implements DibiDriverInterface
public function free()
{
odbc_free_result($this->resultset);
$this->resultset = NULL;
}

View File

@@ -272,6 +272,7 @@ class DibiOracleDriver extends NObject implements DibiDriverInterface
public function free()
{
oci_free_statement($this->resultset);
$this->resultset = NULL;
}

View File

@@ -140,14 +140,14 @@ class DibiPostgreDriver extends NObject implements DibiDriverInterface
{
if ($sequence === NULL) {
// PostgreSQL 8.1 is needed
$res = $this->query("SELECT LASTVAL() AS seq");
$has = $this->query("SELECT LASTVAL() AS seq");
} else {
$res = $this->query("SELECT CURRVAL('$sequence') AS seq");
$has = $this->query("SELECT CURRVAL('$sequence') AS seq");
}
if (is_resource($res)) {
$row = pg_fetch_assoc($res);
pg_free_result($res);
if ($has) {
$row = $this->fetch();
$this->free();
return $row['seq'];
}
@@ -277,6 +277,7 @@ class DibiPostgreDriver extends NObject implements DibiDriverInterface
public function free()
{
pg_free_result($this->resultset);
$this->resultset = NULL;
}