8 require('./tbl_properties_common.php3');
9 $err_url = 'tbl_properties_options.php3' . $err_url;
10 $url_query .= '&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 $sub_part = '_options';
50 require('./tbl_properties_table_info.php3');
54 * Displays form controls
56 if (PMA_MYSQL_INT_VERSION
>= 32322) {
59 <!-- Table comments
-->
61 <form method
="post" action
="tbl_properties_options.php3">
62 <input type
="hidden" name
="server" value
="<?php echo $server; ?>" />
63 <input type
="hidden" name
="lang" value
="<?php echo $lang; ?>" />
64 <input type
="hidden" name
="db" value
="<?php echo $db; ?>" />
65 <input type
="hidden" name
="table" value
="<?php echo $table; ?>" />
66 <?php
echo $strTableComments; ?
> 
;: 
;
67 <input type
="hidden" name
="prev_comment" value
="<?php echo urlencode($show_comment); ?>" /> 
;
68 <input type
="text" name
="comment" maxlength
="60" size
="30" value
="<?php echo htmlspecialchars($show_comment); ?>" class="textfield" style
="vertical-align: middle" onfocus
="this.select()" /> 
;
69 <input type
="submit" name
="submitcomment" value
="<?php echo $strGo; ?>" style
="vertical-align: middle" />
75 // modify robbat2 code - staybyte - 11. June 2001
76 $query = 'SHOW VARIABLES LIKE \'have_%\'';
77 $result = PMA_mysql_query($query);
78 if ($result != FALSE && mysql_num_rows($result) > 0) {
79 while ($tmp = PMA_mysql_fetch_array($result)) {
80 if (isset($tmp['Variable_name'])) {
81 switch ($tmp['Variable_name']) {
83 if ($tmp['Value'] == 'YES') {
88 if ($tmp['Value'] == 'YES') {
93 if ($tmp['Value'] == 'YES') {
98 if ($tmp['Value'] == 'YES') {
103 } // end if isset($tmp['Variable_name'])
107 mysql_free_result($result);
111 <form method
="post" action
="tbl_properties_options.php3">
112 <input type
="hidden" name
="server" value
="<?php echo $server; ?>" />
113 <input type
="hidden" name
="lang" value
="<?php echo $lang; ?>" />
114 <input type
="hidden" name
="db" value
="<?php echo $db; ?>" />
115 <input type
="hidden" name
="table" value
="<?php echo $table; ?>" />
116 <?php
echo $strTableType; ?
> 
;: 
;
117 <select name
="tbl_type" style
="vertical-align: middle">
118 <option value
="MYISAM"<?php
if ($tbl_type == 'MYISAM') echo ' selected="selected"'; ?
>>MyISAM
</option
>
119 <option value
="HEAP"<?php
if ($tbl_type == 'HEAP') echo ' selected="selected"'; ?
>>Heap
</option
>
122 if (isset($tbl_bdb)) {
123 $tbl_types .= ' <option value="BDB"'
124 . (($tbl_type == 'BERKELEYDB') ?
' selected="selected"' : '')
125 . '>Berkeley DB</option>' . "\n";
127 if (isset($tbl_gemini)) {
128 $tbl_types .= ' <option value="GEMINI"'
129 . (($tbl_type == 'GEMINI') ?
' selected="selected"' : '')
130 . '>Gemini</option>' . "\n";
132 if (isset($tbl_innodb)) {
133 $tbl_types .= ' <option value="INNODB"'
134 . (($tbl_type == 'INNODB') ?
' selected="selected"' : '')
135 . '>INNO DB</option>' . "\n";
137 if (isset($tbl_isam)) {
138 $tbl_types .= ' <option value="ISAM"'
139 . (($tbl_type == 'ISAM') ?
' selected="selected"' : '')
140 . '>ISAM</option>' . "\n";
145 <option value
="MERGE"<?php
if ($tbl_type == 'MRG_MYISAM') echo ' selected="selected"'; ?
>>Merge
</option
>
147 <input type
="submit" name
="submittype" value
="<?php echo $strGo; ?>" style
="vertical-align: middle" /> 
;
148 <?php
echo PMA_showDocuShort('T/a/Table_types.html') . "\n"; ?
>
152 <!-- Table options
-->
153 <li style
="vertical-align: top">
154 <table border
="0" cellspacing
="0" cellpadding
="0" style
="vertical-align: top">
157 <form method
="post" action
="tbl_properties_options.php3">
158 <input type
="hidden" name
="server" value
="<?php echo $server; ?>" />
159 <input type
="hidden" name
="lang" value
="<?php echo $lang; ?>" />
160 <input type
="hidden" name
="db" value
="<?php echo $db; ?>" />
161 <input type
="hidden" name
="table" value
="<?php echo $table; ?>" />
163 <table border
="0" cellspacing
="0" cellpadding
="0">
166 <input type
="checkbox" name
="pack_keys" id
="pack_keys_opt"
167 <?php
echo (isset($pack_keys) && $pack_keys == 1) ?
' checked="checked"' : ''; ?
> />
168 <label
for="pack_keys_opt">pack_keys
</label
> 
; 
;
170 <input type
="checkbox" name
="checksum" id
="checksum_opt"
171 <?php
echo (isset($checksum) && $checksum == 1) ?
' checked="checked"' : ''; ?
> />
172 <label
for="checksum_opt">checksum
</label
> 
; 
;
174 <input type
="checkbox" name
="delay_key_write" id
="delay_key_write_opt"
175 <?php
echo (isset($delay_key_write) && $delay_key_write == 1) ?
' checked="checked"' : ''; ?
> />
176 <label
for="delay_key_write_opt">delay_key_write
</label
> 
; 
;
180 <input type
="submit" name
="submitoptions" value
="<?php echo $strGo; ?>" />
191 } // end if (PMA_MYSQL_INT_VERSION >= 32322)
195 * Displays the footer
198 require('./footer.inc.php3');