bug #1733012 Unwanted table alias in delete button
[phpmyadmin/crack.git] / db_create.php
blob8e86c622edc23df5c78179950e5115a7be2432eb
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
5 * @version $Id$
6 */
8 /**
9 * Gets some core libraries
11 require_once './libraries/common.inc.php';
12 $js_to_run = 'functions.js';
13 require_once './libraries/header.inc.php';
14 require_once './libraries/mysql_charsets.lib.php';
17 PMA_checkParameters(array('db'));
19 /**
20 * Defines the url to return to in case of error in a sql statement
22 $err_url = 'main.php?' . PMA_generate_common_url();
24 /**
25 * Builds and executes the db creation sql query
27 $sql_query = 'CREATE DATABASE ' . PMA_backquote($db);
28 if (!empty($db_collation) && PMA_MYSQL_INT_VERSION >= 40101) {
29 list($db_charset) = explode('_', $db_collation);
30 if (in_array($db_charset, $mysql_charsets) && in_array($db_collation, $mysql_collations[$db_charset])) {
31 $sql_query .= ' DEFAULT' . PMA_generateCharsetQueryPart($db_collation);
33 unset($db_charset, $db_collation);
35 $sql_query .= ';';
37 $result = PMA_DBI_query($sql_query);
40 /**
41 * Displays the result and calls default page
43 $message = $strDatabase . ' ' . htmlspecialchars($db) . ' ' . $strHasBeenCreated;
44 require_once './' . $cfg['DefaultTabDatabase'];