]> andersk Git - sql-web.git/blob - test.php
new templates
[sql-web.git] / test.php
1 <?php
2
3 require_once('mitsql.cfg.php');
4 require_once('mitsql.lib.php');
5
6 function getManagedDBs($owner=null) {
7         $databases = array_keys(fetchRows(DBSelect('SHOW DATABASES'),'Database'));
8         $owners = array();
9         foreach($databases as $database) {
10                 if (stristr($database, DELIMETER)) {
11                         $exp = explode(DELIMETER, $database);
12                         $thisowner = array_shift($exp);
13                         if (!is_null($owner) && $thisowner!=$owner) { continue; }
14                         isset($owners[$thisowner]) || $owners[$thisowner] = array();
15                         $owners[$thisowner][] = $database;
16                 }
17         }
18         return $owners;
19 }
20
21 $g = getManagedDBs();
22 print_r($g);
23
24 ?>
This page took 0.035546 seconds and 5 git commands to generate.