summaryrefslogtreecommitdiff
path: root/installer/libraries/Install_Mysqli_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_Mysqli_Driver.php
parentd880c0b7e204d3b232bfc85919f80bade8c638d9 (diff)
Add a check to (e|i)nsure that the database provided is empty
Diffstat (limited to 'installer/libraries/Install_Mysqli_Driver.php')
-rw-r--r--installer/libraries/Install_Mysqli_Driver.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/installer/libraries/Install_Mysqli_Driver.php b/installer/libraries/Install_Mysqli_Driver.php
index ce141066..43894722 100644
--- a/installer/libraries/Install_Mysqli_Driver.php
+++ b/installer/libraries/Install_Mysqli_Driver.php
@@ -66,5 +66,20 @@ class Install_Mysqli_Driver {
return $permissions;
}
+ public function select_db($dbname) {
+ $this->_mysqli->select_db($dbname);
+ }
+
+ public function list_tables($dbname) {
+ $select = "SHOW TABLES FROM $dbname;";
+ $db_tables = $this->_mysqli->query($select);
+ $tables = array();
+ if ($db_tables) {
+ while ($row = $db_tables->fetch_row()) {
+ $tables[strtolower($row[0])] = 1;
+ }
+ }
+ return $tables;
+ }
}