diff options
author | Dieter Adriaenssens <ruleant@users.sourceforge.net> | 2012-04-06 20:08:43 +0400 |
---|---|---|
committer | Dieter Adriaenssens <ruleant@users.sourceforge.net> | 2012-04-06 20:08:43 +0400 |
commit | 091daa394466d40ea13ad8b9059e8c74cb5a04c5 (patch) | |
tree | f26decabf1a78b7c55127c0f8ec3c5de3c53d165 | |
parent | 76ce88555c2dbdfd4aecdc4929ac9b504f12d142 (diff) |
clarify code
-rw-r--r-- | tbl_alter.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tbl_alter.php b/tbl_alter.php index e1103abbc8..961a5a5e00 100644 --- a/tbl_alter.php +++ b/tbl_alter.php @@ -95,8 +95,16 @@ if (isset($_REQUEST['do_save_data'])) { // To allow replication, we first select the db to use and then run queries // on this db. - PMA_DBI_select_db($db) or PMA_mysqlDie(PMA_DBI_getError(), 'USE ' . PMA_backquote($db) . ';', '', $err_url); - $sql_query = 'ALTER TABLE ' . PMA_backquote($table) . ' ' . implode(', ', $changes) . $key_query; + if (! PMA_DBI_select_db($db)) { + PMA_mysqlDie( + PMA_DBI_getError(), + 'USE ' . PMA_backquote($db) . ';', + '', + $err_url + ); + } + $sql_query = 'ALTER TABLE ' . PMA_backquote($table) . ' '; + $sql_query .= implode(', ', $changes) . $key_query; $result = PMA_DBI_try_query($sql_query); if ($result !== false) { |