]> git.nbdom.net Git - nb.git/commitdiff
lib/php/db/table.php
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 12 Dec 2017 20:26:46 +0000 (20:26 +0000)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 12 Dec 2017 20:26:46 +0000 (20:26 +0000)
lib/php/db.php
lib/php/db/table.php
share/sql/host_info.sql [new file with mode: 0644]

index 03bea9f540cd5d51946f4f69a085f1f53ee58cc4..45acaf4e0541ee7e2f9cf8ae97dbdbb0065e1a61 100644 (file)
@@ -217,7 +217,6 @@ class Db extends nb {
         'name' => 'dbname',
         'charset' => 'charset',
       ] as $k => $v) {
-        #self::debug([$k,$this->$k]);
         if ($v=='charset' and $this->type=='pgsql') continue;
         if (empty($this->$k)) continue;
         $this->pdo = preg_replace("/\b$v=[^;]*(;|$)/","",$this->pdo);
index c6f453b5806d88483c3f91f26555da78454cb6d5..4129e24c5a90717cb5915028fcac3321a26422d1 100644 (file)
@@ -1636,11 +1636,6 @@ Class Table extends nb {
 
     $info['rowCount'] = $query->rowCount();
     return $query->rowCount();
-# NB 19.10.17 
-# NB 19.10.17     return $execute;
-# NB 19.10.17 
-# NB 19.10.17     return $this->db()->exec($sql,$values);
-# NB 19.10.17     return $this->db()->exec($sql);
   }
 
   public function update($post,&$info=[]) {
diff --git a/share/sql/host_info.sql b/share/sql/host_info.sql
new file mode 100644 (file)
index 0000000..62aeb01
--- /dev/null
@@ -0,0 +1,13 @@
+DROP TABLE IF EXISTS host_info;
+CREATE TABLE host_info (
+       host VARCHAR(200),      
+       key VARCHAR(100) NOT NULL,      
+       val VARCHAR(500) NOT NULL,      
+       created TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+       PRIMARY KEY (host,key,created)
+);
+CREATE INDEX IF NOT EXISTS host_info_host ON host_info USING btree (host);
+CREATE INDEX IF NOT EXISTS host_info_key ON host_info USING btree (key);
+CREATE INDEX IF NOT EXISTS host_info_val ON host_info USING btree (val);
+CREATE INDEX IF NOT EXISTS host_info_created ON host_info USING btree (created);
+GRANT ALL ON host_info TO www;