Added ability to choose the collation for new databases.
This commit is contained in:
@@ -24,8 +24,12 @@ $err_url = 'main.php?' . PMA_generate_common_url();
|
||||
* Builds and executes the db creation sql query
|
||||
*/
|
||||
$sql_query = 'CREATE DATABASE ' . PMA_backquote($db);
|
||||
if (isset($db_charset) && isset($mysql_charsets) && in_array($db_charset, $mysql_charsets)) {
|
||||
$sql_query .= ' DEFAULT CHARACTER SET ' . $db_charset;
|
||||
if (!empty($db_collation) && PMA_MYSQL_INT_VERSION >= 40101) {
|
||||
list($db_charset) = explode('_', $db_collation);
|
||||
if (in_array($db_charset, $mysql_charsets) && in_array($db_collation, $mysql_collations[$db_charset])) {
|
||||
$sql_query .= ' DEFAULT CHARACTER SET ' . $db_charset . ' COLLATE ' . $db_collation;
|
||||
}
|
||||
unset($db_charset, $db_collation);
|
||||
}
|
||||
$sql_query .= ';';
|
||||
|
||||
|
Reference in New Issue
Block a user