6 * Gets some core libraries
8 require('./libraries/grab_globals.lib.php3');
9 $js_to_run = 'functions.js';
10 require('./libraries/common.lib.php3');
14 * Defines the url to return to in case of error in a sql statement
16 $err_url = 'tbl_properties.php3'
18 . '&convcharset=' . $convcharset
19 . '&server=' . $server
20 . '&db=' . urlencode($db)
21 . '&table=' . urlencode($table);
25 * A new name has been submitted -> do the work
27 if (isset($new_name) && trim($new_name) != '') {
30 if (get_magic_quotes_gpc()) {
31 $new_name = stripslashes($new_name);
34 // Ensure the target is valid
35 if (count($dblist) > 0 && PMA_isInto($db, $dblist) == -1) {
38 if (PMA_MYSQL_INT_VERSION
< 32306) {
39 PMA_checkReservedWords($new_name, $err_url);
42 include('./header.inc.php3');
43 PMA_mysql_select_db($db);
44 $sql_query = 'ALTER TABLE ' . PMA_backquote($old_name) . ' RENAME ' . PMA_backquote($new_name);
45 $result = PMA_mysql_query($sql_query) or PMA_mysqlDie('', '', '', $err_url);
46 $message = sprintf($strRenameTableOK, $old_name, $table);
52 * No new name for the table!
55 include('./header.inc.php3');
56 PMA_mysqlDie($strTableEmpty, '', '', $err_url);
61 * Back to the calling script
63 require('./tbl_properties.php3');