Phpmyadmin Data creation code
<? Php
/* Vim: set expandtab sw = 4 ts = 4 sts = 4 :*/
/**
*
* @ Version $ Id: db_create.php 10469 14: 22: 48Z lem9 $
*/
/**
* Gets some core libraries
*/
Require_once './libraries/common. inc. php ';
$ Js_to_run = 'functions. js ';
Require_once './libraries/mysql_charsets.lib.php ';
PMA_checkParameters (array ('db '));
/**
* Defines the url to return to in case of error in a SQL statement
*/
$ Err_url = 'main. php? '. PMA_generate_common_url ();
/**
* Builds and executes the db creation SQL query
*/
$ SQL _query = 'create database'. PMA_backquote ($ db );
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'. PMA_generateCharsetQueryPart ($ db_collation );
}
Unset ($ db_charset, $ db_collation );
}
$ SQL _query. = ';';
$ Result = PMA_DBI_try_query ($ SQL _query );
If (! $ Result ){
$ Message = PMA_DBI_getError ();
// Avoid displaying the not-created db name in header or navi panel
$ GLOBALS ['db'] = '';
$ GLOBALS ['table'] = '';
Require_once './libraries/header. inc. php ';
Require_once './main. php ';
} Else {
$ Message = $ strDatabase. ''. htmlspecialchars ($ db).''. $ strHasBeenCreated;
Require_once './libraries/header. inc. php ';
Require_once './'. $ cfg ['defaulttabdatabase'];
}
?>