phpMyAdmin Creating Data Codes
/* Vim:set expandtab sw=4 ts=4 sts=4: */
/**
*
* @version $Id: db_create.php 10469 2007-06-29 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 an 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 '];
}
?>
http://www.bkjia.com/PHPjc/630903.html www.bkjia.com true http://www.bkjia.com/PHPjc/630903.html techarticle phpmyadmin Create data code? PHP/* vim:set expandtab sw=4 ts=4 sts=4: *//** * * @version $Id: db_create.php 10469 2007-06-29 1 4:22:48z LEM9 $ *//** * Gets some core libraries ...