Permalink
Browse files

alter partition disabled

  • Loading branch information...
1 parent ba1929d commit 18b7912e1405fe19f0543d6a846c39b687b655db @xianglei committed Jul 13, 2012
Showing with 19 additions and 14 deletions.
  1. +5 −5 alterTable.php
  2. +14 −9 dropColumn.php
View
@@ -166,14 +166,14 @@
if($k == 'name')
{
echo "<td>";
- echo "<a href=# onclick=\"javascript:realconfirm('".$lang['dropColumnConfirm']."','dropPartition.php?database=".$_GET['database']."&table=".$_GET['table']."&column=".$v."');return false;\"><img src=images/b_drop.png>".$lang['dropTable']."</a>";
+ echo "<!--<a href=# onclick=\"javascript:realconfirm('".$lang['dropColumnConfirm']."','dropPartition.php?database=".$_GET['database']."&table=".$_GET['table']."&column=".$v."');return false;\"><img src=images/b_drop.png>".$lang['dropTable']."</a>-->";
echo "</td>";
}
if($k == 'type')
{
echo "<td>";
//echo $v."<br>";
- echo "<select name=partition_type[]>";
+ echo "<select name=partition_type[] disabled>";
foreach($type as $kk => $vv)
{
if ($v == $kk)
@@ -192,14 +192,14 @@
if($k == 'name')
{
echo "<td>";
- echo "<input type=text name=partition_name[] value=".$v.">\n";
- echo "<input type=hidden name=old_partition_name[] value=".$v.">\n";
+ echo "<input type=text name=partition_name[] value=".$v." disabled>\n";
+ echo "<input type=hidden name=old_partition_name[] value=".$v." disabled>\n";
echo "</td>";
}
if($k == 'comment')
{
echo "<td>";
- echo "<input type=text name=partition_comment[] value=".$v.">\n";
+ echo "<input type=text name=partition_comment[] value=".$v." disabled>\n";
//echo "<input type=text name=old_comment[] value=".$v.">\n";
echo "</td>";
}
View
@@ -24,24 +24,29 @@
else
{
echo "<a href=dbStructure.php?database=".$_GET['database'].">".$lang['back']."</a><br><br>";
- $client->execute('desc '.$_GET['table']);
+ $client->execute('desc formatted '.$_GET['table']);
$array_desc_table = $client->fetchAll();
+
+ $etc = new Etc;
+
+ $array_desc_table_1 = $etc->GetTableDetail($array_desc_table, "1");
+
$i = 0;
- while ('' != @$array_desc_table[$i])
+ while ('' != @$array_desc_table_1[$i])
{
- $array_desc = explode(' ',$array_desc_table[$i]);
- $array_desc_desc[$i]['name'] = $array_desc[0];
- $array_desc_desc[$i]['type'] = $array_desc[1];
- $array_desc_desc[$i]['comment'] = $array_desc[2];
- if($array_desc_desc[$i]['name'] == $_GET['column'])
+ $array_desc_1 = explode(' ',$array_desc_table_1[$i]);
+ $array_desc_desc_1[$i]['name'] = trim($array_desc_1[0]);
+ $array_desc_desc_1[$i]['type'] = trim($array_desc_1[1]);
+ $array_desc_desc_1[$i]['comment'] = trim($array_desc_1[2]);
+ if($array_desc_desc_1[$i]['name'] == $_GET['column'])
{
- unset($array_desc_desc[$i]);
+ unset($array_desc_desc_1[$i]);
}
$i++;
}
#-----------construct sql---------
$sql = "ALTER TABLE `".$_GET['table']."` REPLACE COLUMNS ( ";
- foreach($array_desc_desc as $k => $v):
+ foreach($array_desc_desc_1 as $k => $v):
$tmp .= "`".$v['name']."` ".$v['type']." COMMENT '".$v['comment']."',";
endforeach;
#-----------

0 comments on commit 18b7912

Please sign in to comment.