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;
}
}
# 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;