From dac334b46e3f2d939f8d106b98dc82a102e72423 Mon Sep 17 00:00:00 2001 From: Andreas Unterkircher Date: Sat, 9 Jun 2007 06:37:44 +0000 Subject: general function to check if a table exists general function to execute a query without handling results git-svn-id: file:///var/lib/svn/phpfspot/trunk@64 fa6a889d-dae6-447d-9e79-4ba9a3039384 --- phpfspot.class.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'phpfspot.class.php') diff --git a/phpfspot.class.php b/phpfspot.class.php index de2adc0..d62be69 100644 --- a/phpfspot.class.php +++ b/phpfspot.class.php @@ -19,7 +19,10 @@ class PHPFSPOT { $this->cfg = new PHPFSPOT_CFG; $this->db = new PHPFSPOT_DB(&$this, $this->cfg->fspot_db); + $this->cfg_db = new PHPFSPOT_DB(&$this, $this->cfg->phpfspot_db); + $this->check_config_table(); + $this->tmpl = new PHPFSPOT_TMPL($this); $this->get_tags(); @@ -343,6 +346,20 @@ class PHPFSPOT { } // get_meta_informations() + public function check_config_table() + { + // if the config table doesn't exist yet, create it + if(!$this->cfg_db->db_check_table_exists("images")) { + $this->cfg_db->db_exec(" + CREATE TABLE images ( + img_idx int primary key, + img_md5 varchar(32) + ) + "); + } + + } // check_config_table + } ?> -- cgit v1.2.3-18-g5258