3 // vim: expandtab sw=4 ts=4 sts=4:
9 require('./tbl_properties_common.php3');
10 $url_query .= '&goto=tbl_properties_options.php3&back=tbl_properties_options.php3';
14 * Updates table comment, type and options if required
16 if (isset($submitcomment)) {
17 if (get_magic_quotes_gpc()) {
18 $comment = stripslashes($comment);
20 if (empty($prev_comment) ||
urldecode($prev_comment) != $comment) {
21 $sql_query = 'ALTER TABLE ' . PMA_backquote($table) . ' COMMENT = \'' . PMA_sqlAddslashes($comment) . '\'';
22 $result = PMA_mysql_query($sql_query) or PMA_mysqlDie('', $sql_query, '', $err_url);
23 $message = $strSuccess;
26 if (isset($submittype)) {
27 $sql_query = 'ALTER TABLE ' . PMA_backquote($table) . ' TYPE = ' . $tbl_type;
28 $result = PMA_mysql_query($sql_query) or PMA_mysqlDie('', $sql_query, '', $err_url);
29 $message = $strSuccess;
31 if (isset($submitoptions)) {
32 $sql_query = 'ALTER TABLE ' . PMA_backquote($table)
33 . (isset($pack_keys) ?
' pack_keys=1': ' pack_keys=0')
34 . (isset($checksum) ?
' checksum=1': ' checksum=0')
35 . (isset($delay_key_write) ?
' delay_key_write=1': ' delay_key_write=0');
36 $result = PMA_mysql_query($sql_query) or PMA_mysqlDie('', $sql_query, '', $err_url);
37 $message = $strSuccess;
40 // Displays a message if a query had been submitted
41 if (isset($message)) {
42 PMA_showMessage((get_magic_quotes_gpc()) ?
addslashes($message) : $message);
47 * Gets tables informations and displays top links
49 require('./tbl_properties_table_info.php3');
53 * Displays form controls
55 if (PMA_MYSQL_INT_VERSION
>= 32322) {
58 <!-- Table comments
-->
60 <form method
="post" action
="tbl_properties_options.php3">
61 <?php
echo PMA_generate_common_hidden_inputs($db, $table); ?
>
62 <?php
echo $strTableComments; ?
> 
;: 
;
63 <input type
="hidden" name
="prev_comment" value
="<?php echo urlencode($show_comment); ?>" /> 
;
64 <input type
="text" name
="comment" maxlength
="60" size
="30" value
="<?php echo htmlspecialchars($show_comment); ?>" class="textfield" style
="vertical-align: middle" onfocus
="this.select()" /> 
;
65 <input type
="submit" name
="submitcomment" value
="<?php echo $strGo; ?>" style
="vertical-align: middle" />
71 // modify robbat2 code - staybyte - 11. June 2001
72 $query = 'SHOW VARIABLES LIKE \'have_%\'';
73 $result = PMA_mysql_query($query);
74 if ($result != FALSE && mysql_num_rows($result) > 0) {
75 while ($tmp = PMA_mysql_fetch_array($result)) {
76 if (isset($tmp['Variable_name'])) {
77 switch ($tmp['Variable_name']) {
79 if ($tmp['Value'] == 'YES') {
84 if ($tmp['Value'] == 'YES') {
89 if ($tmp['Value'] == 'YES') {
94 if ($tmp['Value'] == 'YES') {
99 } // end if isset($tmp['Variable_name'])
103 mysql_free_result($result);
107 <form method
="post" action
="tbl_properties_options.php3">
108 <?php
echo PMA_generate_common_hidden_inputs($db, $table); ?
>
109 <?php
echo $strTableType; ?
> 
;: 
;
110 <select name
="tbl_type" style
="vertical-align: middle">
111 <option value
="MYISAM"<?php
if ($tbl_type == 'MYISAM') echo ' selected="selected"'; ?
>>MyISAM
</option
>
112 <option value
="HEAP"<?php
if ($tbl_type == 'HEAP') echo ' selected="selected"'; ?
>>Heap
</option
>
115 if (isset($tbl_bdb)) {
116 $tbl_types .= ' <option value="BDB"'
117 . (($tbl_type == 'BERKELEYDB') ?
' selected="selected"' : '')
118 . '>Berkeley DB</option>' . "\n";
120 if (isset($tbl_gemini)) {
121 $tbl_types .= ' <option value="GEMINI"'
122 . (($tbl_type == 'GEMINI') ?
' selected="selected"' : '')
123 . '>Gemini</option>' . "\n";
125 if (isset($tbl_innodb)) {
126 $tbl_types .= ' <option value="INNODB"'
127 . (($tbl_type == 'INNODB') ?
' selected="selected"' : '')
128 . '>INNO DB</option>' . "\n";
130 if (isset($tbl_isam)) {
131 $tbl_types .= ' <option value="ISAM"'
132 . (($tbl_type == 'ISAM') ?
' selected="selected"' : '')
133 . '>ISAM</option>' . "\n";
138 <option value
="MERGE"<?php
if ($tbl_type == 'MRG_MYISAM') echo ' selected="selected"'; ?
>>Merge
</option
>
140 <input type
="submit" name
="submittype" value
="<?php echo $strGo; ?>" style
="vertical-align: middle" /> 
;
141 <?php
echo PMA_showMySQLDocu('Table_types', 'Table_types') . "\n"; ?
>
145 <!-- Table options
-->
146 <li style
="vertical-align: top">
147 <table border
="0" cellspacing
="0" cellpadding
="0" style
="vertical-align: top">
150 <form method
="post" action
="tbl_properties_options.php3">
151 <?php
echo PMA_generate_common_hidden_inputs($db, $table); ?
>
153 <table border
="0" cellspacing
="0" cellpadding
="0">
156 <input type
="checkbox" name
="pack_keys" id
="pack_keys_opt"
157 <?php
echo (isset($pack_keys) && $pack_keys == 1) ?
' checked="checked"' : ''; ?
> />
158 <label
for="pack_keys_opt">pack_keys
</label
> 
; 
;
160 <input type
="checkbox" name
="checksum" id
="checksum_opt"
161 <?php
echo (isset($checksum) && $checksum == 1) ?
' checked="checked"' : ''; ?
> />
162 <label
for="checksum_opt">checksum
</label
> 
; 
;
164 <input type
="checkbox" name
="delay_key_write" id
="delay_key_write_opt"
165 <?php
echo (isset($delay_key_write) && $delay_key_write == 1) ?
' checked="checked"' : ''; ?
> />
166 <label
for="delay_key_write_opt">delay_key_write
</label
> 
; 
;
170 <input type
="submit" name
="submitoptions" value
="<?php echo $strGo; ?>" />
181 } // end if (PMA_MYSQL_INT_VERSION >= 32322)
185 * Displays the footer
188 require('./footer.inc.php3');