summaryrefslogtreecommitdiff
path: root/installer/libraries
diff options
context:
space:
mode:
Diffstat (limited to 'installer/libraries')
-rw-r--r--installer/libraries/Install_Mysql_Driver.php15
-rw-r--r--installer/libraries/Install_Mysqli_Driver.php15
2 files changed, 30 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;
+ }
}
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;
+ }
}