Skip to content

Commit

Permalink
put similar things together
Browse files Browse the repository at this point in the history
  • Loading branch information
scnakandala committed Aug 16, 2013
1 parent dfb6cdb commit a26ad78
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions tbl_create.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
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'));
Expand All @@ -26,8 +26,17 @@
}

/**
* 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(
Expand All @@ -38,22 +47,11 @@
);
}


// 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
Expand Down

0 comments on commit a26ad78

Please sign in to comment.