From: Nicolas Boisselier Date: Wed, 6 Jan 2016 22:42:48 +0000 (+0000) Subject: add param db for sort X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=babbef6a6005e1b8be47988f791670f485d14916;p=nb.git add param db for sort --- diff --git a/lib/php/db/table.php b/lib/php/db/table.php index a19eb134..462d62b1 100644 --- a/lib/php/db/table.php +++ b/lib/php/db/table.php @@ -108,6 +108,7 @@ class table extends nb { function fields($name=null) { if ($this->fields === null) { + $this->fields = array(); if ($this->db->type == 'sqlite') { $sql = "PRAGMA table_info('$this->name')"; @@ -131,7 +132,6 @@ FROM pg_catalog.pg_attribute a WHERE a.attrelid = (SELECT c.oid FROM pg_catalog. } $rows = $this->db->conn->query($sql); - $rows->setFetchMode(PDO::FETCH_ASSOC); foreach ($rows as $row) { @@ -328,6 +328,7 @@ FROM pg_catalog.pg_attribute a WHERE a.attrelid = (SELECT c.oid FROM pg_catalog. } + if ($this->p('db')) $params['db'] = $this->p('db'); $flat = array(); foreach ($params as $k=>$v) { $flat[] = $k.'='.urlencode($v); } return $flat ? '?'. join('&',$flat) : '';