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:
authorSpun Nakandala <supun.nakandala@gmail.com>2013-08-16 22:37:38 +0400
committerSpun Nakandala <supun.nakandala@gmail.com>2013-08-16 22:37:38 +0400
commita26ad78e5dfb7a96e4ff0f1a0427f5d5850de886 (patch)
tree728735db81595c4e22341ccace684c0d2d7ffc92 /tbl_create.php
parentdfb6cdb4ade3f8ebbdc6c47ecb97d693f60e0c4e (diff)
put similar things together
Diffstat (limited to 'tbl_create.php')
-rw-r--r--tbl_create.php28
1 files changed, 13 insertions, 15 deletions
diff --git a/tbl_create.php b/tbl_create.php
index ed74bf5696..0404542ace 100644
--- a/tbl_create.php
+++ b/tbl_create.php
@@ -13,7 +13,7 @@ require_once 'libraries/common.inc.php';
include_once 'libraries/create_addfield.lib.php';
// for libraries/tbl_columns_definition_form.inc.php
-$action = 'tbl_create.php';
+
// Check parameters
PMA_Util::checkParameters(array('db'));
@@ -26,8 +26,17 @@ if (strlen($db) == 0) {
}
/**
- * Defines the url to return to in case of error in a sql statement
+ * Selects the database to work with
*/
+if (!$GLOBALS['dbi']->selectDb($db)) {
+ PMA_Util::mysqlDie(
+ sprintf(__('\'%s\' database does not exist.'), htmlspecialchars($db)),
+ '',
+ '',
+ 'index.php'
+ );
+}
+
if ($GLOBALS['dbi']->getColumns($db, $table)) {
// table exists already
PMA_Util::mysqlDie(
@@ -38,22 +47,11 @@ if ($GLOBALS['dbi']->getColumns($db, $table)) {
);
}
-
-// check number of fields to be created
// for libraries/tbl_columns_definition_form.inc.php
+// check number of fields to be created
$num_fields = PMA_getNumberOfFieldsFromRequest();
-/**
- * Selects the database to work with
- */
-if (!$GLOBALS['dbi']->selectDb($db)) {
- PMA_Util::mysqlDie(
- sprintf(__('\'%s\' database does not exist.'), htmlspecialchars($db)),
- '',
- '',
- 'index.php'
- );
-}
+$action = 'tbl_create.php';
/**
* The form used to define the structure of the table has been submitted