summaryrefslogtreecommitdiff
path: root/installer/libraries/Install_Mysql_Driver.php
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-01-12 05:12:17 +0000
committerTim Almdal <tnalmdal@shaw.ca>2009-01-12 05:12:17 +0000
commite02c5759bba275c273ab16d8923bff3ea6f24663 (patch)
tree1e1b103932f62768200f3171b451aaa770ccd4ea /installer/libraries/Install_Mysql_Driver.php
parentd880c0b7e204d3b232bfc85919f80bade8c638d9 (diff)
Add a check to (e|i)nsure that the database provided is empty
Diffstat (limited to 'installer/libraries/Install_Mysql_Driver.php')
-rw-r--r--installer/libraries/Install_Mysql_Driver.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/installer/libraries/Install_Mysql_Driver.php b/installer/libraries/Install_Mysql_Driver.php
index aac49acd..d380b140 100644
--- a/installer/libraries/Install_Mysql_Driver.php
+++ b/installer/libraries/Install_Mysql_Driver.php
@@ -61,4 +61,19 @@ class Install_Mysql_Driver {
return $permissions;
}
+ public function select_db($dbname) {
+ mysql_select_db($dbname);
+ }
+
+ public function list_tables($dbname) {
+ $select = "SHOW TABLES FROM $dbname;";
+ $db_tables = mysql_query($select, $this->_link);
+ $tables = array();
+ if ($db_tables) {
+ while ($row = mysql_fetch_assoc($db_tables)) {
+ $tables[$row["Tables_in_$dbname"]] = 1;
+ }
+ }
+ return $tables;
+ }
}