Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Čihař <michal@cihar.com>2003-11-18 18:20:45 +0300
committerMichal Čihař <michal@cihar.com>2003-11-18 18:20:45 +0300
commit6884f9701a4052cf03c2af98ce799d2fd41241f5 (patch)
tree0037946d485432525dcf0d55b3e5399113192e1b /db_create.php
parent4edf711ada5dc95ed7bb1ff2f57f1f8a1f67bd86 (diff)
no more support for php3
Diffstat (limited to 'db_create.php')
-rw-r--r--db_create.php45
1 files changed, 45 insertions, 0 deletions
diff --git a/db_create.php b/db_create.php
new file mode 100644
index 0000000000..26de2f08f5
--- /dev/null
+++ b/db_create.php
@@ -0,0 +1,45 @@
+<?php
+/* $Id$ */
+// vim: expandtab sw=4 ts=4 sts=4:
+
+
+/**
+ * Gets some core libraries
+ */
+require('./libraries/grab_globals.lib.php');
+$js_to_run = 'functions.js';
+require('./header.inc.php');
+
+if (!defined('PMA_COMMON_LIB_INCLUDED')) {
+ include('./libraries/common.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();
+
+/**
+ * Ensures the db name is valid
+ */
+if (PMA_MYSQL_INT_VERSION < 32306) {
+ PMA_checkReservedWords($db, $err_url);
+}
+
+
+/**
+ * Executes the db creation sql query
+ */
+$sql_query = 'CREATE DATABASE ' . PMA_backquote($db);
+$result = PMA_mysql_query('CREATE DATABASE ' . PMA_backquote($db)) or PMA_mysqlDie('', $sql_query, FALSE, $err_url);
+
+
+/**
+ * Displays the result and calls default page
+ */
+$message = $strDatabase . ' ' . htmlspecialchars($db) . ' ' . $strHasBeenCreated;
+require('./' . $cfg['DefaultTabDatabase']);
+
+?>