diff --git a/src/databases/firebird.php b/src/databases/firebird.php index 0acd816..2c321a7 100644 --- a/src/databases/firebird.php +++ b/src/databases/firebird.php @@ -69,21 +69,50 @@ class firebird { /** * Emulate PDO fetch function * + * @param int $fetch_style * @return mixed */ - function fetch() + function fetch($fetch_style=PDO::FETCH_ASSOC) { - //TODO implement + switch($fetch_style) + { + case PDO::FETCH_OBJ: + return ibase_fetch_object($this->statement); + break; + + case PDO::FETCH_NUM: + return ibase_fetch_row($this->statement); + break; + + case PDO::FETCH_BOTH: + return array_merge( + ibase_fetch_row($this->statement), + ibase_fetch_assoc($this->statement) + ); + break; + + default: + return ibase_fetch_assoc($this->statement); + break; + } } /** * Emulate PDO fetchAll function * + * @param int $fetch_style * @return mixed */ - function fetchAll() + function fetchAll($fetch_style=PDO::FETCH_ASSOC) { - //TODO implement + $all = array(); + + while($row = $this->fetch($fetch_style)) + { + $all[] = $row; + } + + return $all; } /** @@ -115,7 +144,7 @@ class firebird { */ function affected_rows() { - // TODO: Implement + return ibase_affected_rows($this->conn); } /** @@ -137,7 +166,10 @@ class firebird_manip extends firebird { parent::__construct($db, $user, $pass); } - + function create_table($name, $fields, $constraints=array()) + { + $sql = "CREATE TABLE {$name}"; + } } // End of firebird.php \ No newline at end of file diff --git a/tests/test_dbs/FB_TEST_DB.FDB b/tests/test_dbs/FB_TEST_DB.FDB new file mode 100644 index 0000000..f4a8e1e Binary files /dev/null and b/tests/test_dbs/FB_TEST_DB.FDB differ diff --git a/tests/test_dbs/test_sqlite.db b/tests/test_dbs/test_sqlite.db new file mode 100644 index 0000000..1822bdd Binary files /dev/null and b/tests/test_dbs/test_sqlite.db differ