Added transaction functions to firebird driver

This commit is contained in:
Timothy Warren 2012-02-20 16:53:24 -05:00
parent c938964260
commit 09b0b1fbe3
2 changed files with 38 additions and 2 deletions

View File

@ -19,7 +19,7 @@
*/
class firebird {
protected $conn, $statement;
protected $conn, $statement, $trans;
private $esc_char = "''";
/**
@ -212,6 +212,41 @@ SQL;
}
return $count;
}
/**
* Start a database transaction
*
* @return resource
*/
function beingTransaction()
{
if($this->trans = ibase_trans($this->conn) !== null)
{
return TRUE;
}
return FALSE;
}
/**
* Commit a database transaction
*
* @return bool
*/
function commit()
{
return ibase_commit($this->trans);
}
/**
* Rollback a transaction
*
* @return bool
*/
function rollBack()
{
return ibase_rollback($this->trans);
}
}
// End of firebird.php

View File

@ -77,7 +77,8 @@ class Add_DB extends GtkWindow {
// DB File
{
$filelbl = new GtkLabel("Database file");
$this->dbfile = new GtkFileChooserButton("Select a database file", Gtk::FILE_CHOOSER_ACTION_OPEN);
$this->dbfile = new GtkFileChooserButton("Select a database file",
Gtk::FILE_CHOOSER_ACTION_OPEN);
$filealign = new GtkAlignment(0, 0.5, 0, 0);
$filealign->add($filelbl);