From: Nicolas Boisselier Date: Wed, 10 Aug 2016 09:21:23 +0000 (+0100) Subject: rename db.sqlite into wp.sqlite X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=d1af78399f876230929d95151135c24764ad3eee;p=nb.git rename db.sqlite into wp.sqlite --- diff --git a/lib/php/db.php b/lib/php/db.php index bab7b46b..629419c9 100644 --- a/lib/php/db.php +++ b/lib/php/db.php @@ -822,16 +822,18 @@ return; if (!isset($this->databases)) { + $this->databases = []; $name = self::p('name',''); - $sql = $this->type('databases'); - if (!$sql) return []; + if ($sql = $this->type('databases')) { - $st = $this->conn->prepare($sql); - $st->execute(); - $this->databases = []; + $st = $this->conn->prepare($sql); + $st->execute(); + $this->databases = []; + + while ($row = $st->fetch(PDO::FETCH_ASSOC, PDO::FETCH_ORI_NEXT)) { + $this->databases[] = $row; + } - while ($row = $st->fetch(PDO::FETCH_ASSOC, PDO::FETCH_ORI_NEXT)) { - $this->databases[] = $row; } } diff --git a/lib/php/out.php b/lib/php/out.php index 82838444..4e439f78 100644 --- a/lib/php/out.php +++ b/lib/php/out.php @@ -233,6 +233,7 @@ Class Out extends Nb { # Ex: for action=tables when header=0 + if (empty($data)) return; if (is_scalar($data)) $data = array(array($data)); if (!isset(self::$types[$type])) self::bye("Unknow type: `$type`"); $conf = self::$types[$type] + $conf;