]> git.mjollnir.org Git - moodle.git/commitdiff
Added support to retrofit tables without prefix
authorstronk7 <stronk7>
Tue, 5 Sep 2006 17:55:59 +0000 (17:55 +0000)
committerstronk7 <stronk7>
Tue, 5 Sep 2006 17:55:59 +0000 (17:55 +0000)
admin/xmldb/actions/new_table_from_mysql/new_table_from_mysql.class.php

index 162cb70f1fff022c84fc1e24df8d699355e0f600..df3cd84f8fc81c76565e4a3241f5e8d1c0cb1205 100644 (file)
@@ -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