]> andersk Git - sql-web.git/blame - test.php
git-svn-id: svn://presbrey.mit.edu/sql/mitsql@46 a142d4bd-2cfb-0310-9673-cb33a7e74f58
[sql-web.git] / test.php
CommitLineData
b43ab1a6
JP
1<?php
2
997305cf
JP
3require_once('mitsql.cfg.php');
4require_once('mitsql.lib.php');
5
377015e0
JP
6function 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}
997305cf 20
377015e0
JP
21$g = getManagedDBs();
22print_r($g);
997305cf 23
377015e0 24?>
This page took 1.163488 seconds and 5 git commands to generate.