hi all
i have problem when i wanna update some data in the mysql, here is the code :
PHP Code:
<? 

if ($action  == "renamesubcat") {

?>

<form method="POST" action="<?=$PHP_SELF;?>?action=resubcat">
<input type="hidden" name="recat" value="1">
<div align="center">
<center>
<table border="0" cellspacing="1" cellpadding="3" class="table_border">
<tr>
<td colspan="2" class="header_cell">
<p align="center">.:: Rename Sub Catagory <font color="#ff6600"><?=$sub_cat_n;?></font> ::.</p>
</td>
</tr>

<!-- ##################### -->

<tr>
<td align="right" class="cells">Name :</td>
<td class="cells"><input class="box" type="text" name="sub_cat_n1" size="30" value="<?=$sub_cat_n;?>"></td>
</tr>

<tr>
<td align="right" class="cells"> Sorting In Catagory :</td>
<td class="cells">
<?
/*
##################################
##### make Catagory List #########
##################################  */
$sql_cat="select * from catagory";
$result_cat=@mysql_query($sql_cat,$db);

echo 
"

  <select name=\"catagory1\">
  "
;
          while(
$mycat=@mysql_fetch_array($result_cat))
    {
$catagory_id=$mycat["catagory_id"];
$catagory=$mycat["catagory"];


  echo
"<option value=\"$catagory\">$catagory_id . $catagory</option>";
}
echo
"</select>";?>


</td>
</tr



<tr>
<td colspan="2" class="header_cell">
<p align="center"><input type="submit" name="submit">
</td></tr>

</div>
</table>
<?}
 if(
$action == "resubcat" ){


if (
$sub_cat_n1==""){
      echo 
"<center><font color=\"#ff0000\"> you must write the new sub catagory name!<br>";
      echo
"<a href=\"javascript:history.back(-1);\">Back</a>";
  }else {


$sql "update sub_cat set sub_cat_n='$sub_cat_n1', catagory='$catagory1' where sub_cat_n='$sub_cat_n'";
// here is the problem !
$result=mysql_query($sql,$db);


echo 
mysql_error();
   echo
"<center>Rename sub catagory to<font color=\"#ff6600\"> $sub_cat_n1</font>, has been done$b</center>";
     }

}


    
?>
mysql :
Code:
Field Type Attributes Null Default Extra Action 
sub_cat_id  int(7)    No    auto_increment  Change Drop Primary Index Unique 
sub_cat_n  varchar(30)    Yes      Change Drop Primary Index Unique 
catagory  varchar(30)    Yes      Change Drop Primary Index Unique
after updating i got msg its ok, but no changes !!
any1 know whay ??


thx alot !