From bc942ab58ab2bc0fc9aba408fa1ca53079f73ee4 Mon Sep 17 00:00:00 2001 From: stronk7 Date: Tue, 5 Sep 2006 17:55:59 +0000 Subject: [PATCH] Added support to retrofit tables without prefix --- .../new_table_from_mysql/new_table_from_mysql.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/admin/xmldb/actions/new_table_from_mysql/new_table_from_mysql.class.php b/admin/xmldb/actions/new_table_from_mysql/new_table_from_mysql.class.php index 162cb70f1ff..df3cd84f8fc 100644 --- a/admin/xmldb/actions/new_table_from_mysql/new_table_from_mysql.class.php +++ b/admin/xmldb/actions/new_table_from_mysql/new_table_from_mysql.class.php @@ -131,7 +131,10 @@ class new_table_from_mysql extends XMLDBAction { $table = new XMLDBTable(strtolower(trim($tableparam))); $table->setComment($table->getName() . ' table retrofitted from MySQL'); /// Get fields info from ADODb - $dbfields = $db->MetaColumns($CFG->prefix . $tableparam); + if(!$dbfields = $db->MetaColumns($CFG->prefix . $tableparam)) { + ///Try it without prefix if doesn't exist + $dbfields = $db->MetaColumns($tableparam); + } if ($dbfields) { foreach ($dbfields as $dbfield) { /// Create new XMLDB field