diff --git a/src/databases/sqlite.php b/src/databases/sqlite.php index 390c07c..417ee75 100644 --- a/src/databases/sqlite.php +++ b/src/databases/sqlite.php @@ -19,6 +19,8 @@ */ class SQLite extends DB_PDO { + protected $statement; + /** * Open SQLite Database * @@ -42,11 +44,11 @@ class SQLite extends DB_PDO { { // SQLite has a TRUNCATE optimization, // but no support for the actual command. - $sql = <<query($sql); + $this->prepare_query($sql, array( + ':table' => $table + )); } /** @@ -58,7 +60,9 @@ SQL; { $tables = array(); $sql = <<query($sql); @@ -92,9 +96,7 @@ SQL; */ public function load_database($db, $name) { - $sql = <<query($sql); } @@ -105,10 +107,11 @@ SQL; */ public function unload_database($name) { - $sql = <<query($sql); + $sql = 'DETACH DATABASE ":name"'; + + $this->prepare_query($sql, array( + ':name' => $name, + )); } /** @@ -118,7 +121,7 @@ SQL; */ public function num_rows() { - return (isset($this->statement)) ? $this->statment->rowCount : FALSE; + return (isset($this->statement)) ? $this->statement->rowCount : FALSE; } } //End of sqlite.php \ No newline at end of file diff --git a/src/windows/main.php b/src/windows/main.php index 3c1bfd0..0e244aa 100644 --- a/src/windows/main.php +++ b/src/windows/main.php @@ -260,6 +260,7 @@ class Main extends GtkWindow { } else { + // Load an empty image if the db image doesn't exist $img = new GtkImage(); $cell->set_property('pixbuf', $img->get_pixbuf()); } @@ -280,16 +281,6 @@ class Main extends GtkWindow { $cell->set_property('text', $info->name); } - /** - * Redraws the data area based on the which connection is selected - * - * @param $selection - */ - private function _render_selected($selection) - { - - } - // -------------------------------------------------------------------------- /**