i've programming library file system
there error in Control Panel
there are catagory table
this code fetch items from catagory table in DB & show it as table:
<?
include("../config.php");
$SQL_Select_catag=mysql_query("select * from catagory");
echo '<center><a href="add_catagory.php">Add Catagory</a></center><br>';
echo '<table width="300" border="1" align="center" style="border: 1px dotted #000000" cellspacing="0" cellpadding="0" >';
while (list($Id,$cat_name)=mysql_fetch_array($SQL_Select_catag))
{
$iid=$Id;
echo "<tr><td>";
echo $iid;
echo "</td><td>";
echo $cat_name;
echo "</td><td>";
echo '<a href= "edit_cat.php?cat_IDno=';
echo $iid;
echo '">Edit</a>';
echo "</td><td>";
echo '<a href= "delete_cat.php?cat_IDno=';
echo $iid;
echo '">Delete</a>';
echo "</td></tr>";
}
echo "</table>";
echo '<center><a href="add_catagory.php">Add Catagory</a></center>';
echo "<center><br>";
?>
if Clicked Edit link in table will go to Edit Page & this is the code :
<?
include("../config.php");
$_POST['cat_IDno'];
if ($Cname != null )
{
$sql_update_catag="update catagory set cat_name='$Cname' where Id='$cat_IDno'";
$qr=mysql_query($sql_update_catag);
if ($qr == true)
{
echo "Updated Done";
}
else
{
echo "Not Done";
}
}
else
{
$SQL_Statment_catag=mysql_query("select * from catagory where Id=$cat_IDno");
$SQL_Arr_catag=mysql_fetch_array($SQL_Statment_catag);
$ccname=$SQL_Arr_catag[1];
?>
<form action="edit_cat.php" method="POST">
<center>
Catagory Name: <input type="text" name="Cname" id="Cname" value="<? echo $ccname; ?>">
<br>
<input type="submit" value="Edit">
</center></form>
<?
}
?>
Now when Press Edit Button showing Message
" Updated Done "
and it's not updated !!
what is the problem ??
please help me today !!!!!


Sign In
Create Account

Back to top









