From d1af78399f876230929d95151135c24764ad3eee Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Wed, 10 Aug 2016 10:21:23 +0100 Subject: [PATCH] rename db.sqlite into wp.sqlite --- lib/php/db.php | 16 +++++++++------- lib/php/out.php | 1 + 2 files changed, 10 insertions(+), 7 deletions(-) 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; -- 2.47.3