6 * Gets some core libraries
8 require('./grab_globals.inc.php3');
9 require('./header.inc.php3');
13 * Modifications have been submitted -> updates the table
16 // Some fields have been urlencoded or double quotes have been translated
17 // to """ in tbl_properties.php3
18 $field_orig[0] = urldecode($field_orig[0]);
19 if (str_replace('"', '"', $field_orig[0]) == $field_name[0]) {
20 $field_name[0] = $field_orig[0];
22 $field_default_orig[0] = urldecode($field_default_orig[0]);
23 if (str_replace('"', '"', $field_default_orig[0]) == $field_default[0]) {
24 $field_default[0] = $field_default_orig[0];
30 $query .= ' ' . backquote($field_orig[0]) . ' ' . backquote($field_name[0]) . ' ' . $field_type[0] . ' ';
31 if ($field_length[0] != '') {
32 $query .= '(' . $field_length[0] . ') ';
34 if ($field_attribute[0] != '') {
35 $query .= $field_attribute[0] . ' ';
37 if ($field_default[0] != '') {
38 $query .= 'DEFAULT \'' . sql_addslashes($field_default[0]) . '\' ';
40 $query .= $field_null[0] . ' ' . $field_extra[0];
41 if (get_magic_quotes_gpc()) {
42 $query = stripslashes($query);
45 // Optimization fix - 2 May 2001 - Robbat2
46 $sql_query = 'ALTER TABLE ' . backquote($db) . '.' . backquote($table) . ' CHANGE ' . $query;
47 $result = mysql_query($sql_query) or mysql_die();
48 $message = $strTable . ' ' . htmlspecialchars($table) . ' ' . $strHasBeenAltered;
49 include('./tbl_properties.php3');
55 * No modifications yet required -> displays the table fields
58 if (get_magic_quotes_gpc()) {
59 $field = sql_addslashes(stripslashes($field), TRUE);
61 $field = sql_addslashes($field, TRUE);
63 $result = mysql_query('SHOW FIELDS FROM ' . backquote($db) . '.' . backquote($table) . " LIKE '$field'") or mysql_die();
64 $num_fields = mysql_num_rows($result);
65 $action = 'tbl_alter.php3';
66 include('./tbl_properties.inc.php3');
73 require('./footer.inc.php3');