" .$clang->gT("Create Database")."

\n"; echo $clang->gT("Creating tables. This might take a moment...")."

 \n"; // In Step2 fill the database with data if (returnglobal('createdbstep2')==$clang->gT("Populate Database")) { $createdbtype=$databasetype; if ($databasetype=='mysql' || $databasetype=='mysqli') { @$connect->Execute("ALTER DATABASE `$dbname` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;"); $createdbtype='mysql'; } if ($createdbtype=='mssql_n' || $createdbtype=='odbc_mssql' || $createdbtype=='odbtp') $createdbtype='mssql'; if($createdbtype=='postgres' && $connect->pgVersion=='9') { $connect->execute("ALTER DATABASE {$dbname} SET bytea_output='escape';"); } if($createdbtype=='mssqlnative') $createdbtype='mssqlnative'; if (modify_database(dirname(__FILE__).'/create-'.$createdbtype.'.sql')) { echo "

\n"; echo sprintf($clang->gT("Database `%s` has been successfully populated."),$dbname)."

 \n"; echo ""; exit; } else { echo $modifyoutput; echo"Error"; } } if (!$dbname) { echo "
$setfont".$clang->gT("Error")."
\n"; echo $clang->gT("Database Information not provided. This script must be run from admin.php only."); echo "

\n"; echo ""; exit; } if (!$database_exists) //Database named in config-defaults.php does not exist { // TODO SQL: Portable to other databases?? switch ($databasetype) { case 'mysqli': case 'mysql': $createDb=$connect->Execute("CREATE DATABASE `$dbname` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci"); break; case 'mssql_n': case 'odbc_mssql': case 'mssqlnative': case 'odbtp': $createDb=$connect->Execute("CREATE DATABASE [$dbname];"); break; default: $createDb=$connect->Execute("CREATE DATABASE $dbname"); } if ($createDb) //Database has been successfully created { $connect->database = $dbname; $connect->Execute("USE DATABASE `$dbname`"); echo "
$setfont\n"; echo $clang->gT("Database has been created.")."

\n"; echo $clang->gT("Please click below to populate the database")."

\n"; echo "

"; echo "
"; } else { echo "$setfont".$clang->gT("Error")."
\n"; echo $clang->gT("Could not create database")." ($dbname)
\n"; echo $connect->ErrorMsg(); echo "

\n"; echo ""; } } echo "\n"; ?>