]> andersk Git - sql-web.git/blame - test.php
git-svn-id: svn://presbrey.mit.edu/sql/mitsql@53 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
88b7d384
JP
6include 'tpl/head.php';
7
377015e0 8function getManagedDBs($owner=null) {
88b7d384
JP
9// $databases = array_keys(fetchRows(DBSelect('SHOW DATABASES'),'Database'));
10 $databases = array_keys(fetchRows(DBSelect('SELECT Name FROM DB'),'Name'));
377015e0
JP
11 $owners = array();
12 foreach($databases as $database) {
13 if (stristr($database, DELIMETER)) {
14 $exp = explode(DELIMETER, $database);
15 $thisowner = array_shift($exp);
16 if (!is_null($owner) && $thisowner!=$owner) { continue; }
17 isset($owners[$thisowner]) || $owners[$thisowner] = array();
18 $owners[$thisowner][] = $database;
19 }
20 }
21 return $owners;
22}
997305cf 23
88b7d384 24/*
377015e0
JP
25$g = getManagedDBs();
26print_r($g);
88b7d384
JP
27*/
28
29$User = new User($Login->getUserId());
30print_r($User->getDBList());
997305cf 31
88b7d384
JP
32include 'tpl/foot.php';
33?>
This page took 0.418591 seconds and 5 git commands to generate.