using a form similiar to below:
<table width='100%' cellpadding=0 cellspacing=0 border=1 bordercolor='#eeeeee'><tr>
<form name="frm" action="addcat.php" method="post"><td valign='top' align='center'>
Category:</TD>
<TD><input type="text" name="newcat" value=""></TD>
<TD><input type=submit value='Add Category' name='Submit'></TD>
</TR></form></table>
to insert into your database you would use something like this below:
[php]
$query = “INSERT INTO class_item (id,sub,cat) VALUES (’’,’$cat_id’,’$newcat)”;
mysql_query($query) or die(‘Error, query failed’);
echo “[ Posted Successfully ]
”;
[/php]
Or to update use something like this:
[php]
$query = “UPDATE category_table SET sub = ‘$main_category_id’, cat = ‘$new_cat_name’”;
$result = mysql_query($query) OR die(mysql_error());
[/php]
Or to delete use something like this:
[php]
$query = “DELETE FROM category_table WHERE id=’$id’”;
$result = mysql_query($query) OR die(mysql_error());
[/php]
You might find this tutorial for a news script interesting here at
http://www.maaking.com/index.php?loadpage=tutorials
when I try to find information like this, I try to look up on yahoo.com for “php tutorial, mysql delete” or “php tutorial, mysql insert” or so on… without the quotes ( " ).
(if someone wants to correct me on any of the above, please do, dont claim to be perfect, but these should work.)
Now remember, this is only to add, update, and delete your categories, not how to show them on your page… or counting.