Index: install.php =================================================================== RCS file: /cvsroot/moodle/moodle/install.php,v retrieving revision 1.73 diff -u -r1.73 install.php --- install.php 15 Apr 2007 14:44:28 -0000 1.73 +++ install.php 23 Apr 2007 09:45:14 -0000 @@ -337,22 +337,18 @@ error_reporting(0); // Hide errors if (! $dbconnected = $db->Connect($INSTALL['dbhost'],$INSTALL['dbuser'],$INSTALL['dbpass'],$INSTALL['dbname'])) { - /// The following doesn't seem to work but we're working on it - /// If you come up with a solution for creating a database in MySQL - /// feel free to put it in and let us know + $db->database = ''; // reset database name cached by ADODB if ($dbconnected = $db->Connect($INSTALL['dbhost'],$INSTALL['dbuser'],$INSTALL['dbpass'])) { - switch ($INSTALL['dbtype']) { /// Try to create a database - case 'mysql': - if ($db->Execute("CREATE DATABASE {$INSTALL['dbname']};")) { - $dbconnected = $db->Connect($INSTALL['dbhost'],$INSTALL['dbuser'],$INSTALL['dbpass'],$INSTALL['dbname']); - } else { - $errormsg = get_string('dbcreationerror', 'install'); - $nextstage = DATABASE; - } - break; + /// Try to create a database + if ($db->Execute("CREATE DATABASE {$INSTALL['dbname']};")) { + $dbconnected = $db->Connect($INSTALL['dbhost'],$INSTALL['dbuser'],$INSTALL['dbpass'],$INSTALL['dbname']); + } else { + $dbconnected = false; } } - } else { + } + + if ( $dbconnected ) { /// We have been able to connect properly, just test the database encoding now. /// It must be Unicode for 1.8 installations. $encoding = '';