I just noticed after copying and pasting your code into notepad to check all your brackets, your update code is put inside the if statement that checks if the submit button was not clicked.
So...
<?php
if(!$_POST['add_submit']) {
?>
<form method="post" action="" enctype="multipart/form-data">
<?php
switch($_GET['func']) {
default:
case "view":
// view
if($_GET['a'] == "sections") {
// show the sections
?>
<table class="list">
<tr class="listHead">
<td>id</td><td>section</td><td>edit</td><td>delete</td>
</tr>
<?php
$query = mysql_query("SELECT * FROM cms_forums");
while($row = mysql_fetch_array($query)) {
?>
<tr class="listData">
<td><?=$row['id']; ?></td><td><a href="forums.php" target="_blank"><?=substr(stripslashes($row['title']), 0, 100); ?></a></td><td><a href="?func=edit&section=<?=$row['id']; ?>">edit</a></td><td><a href="?func=delete&section=<?=$row['id']; ?>" onclick="return confirm('Are you sure you want to delete section <?=$row['title']; ?>?')">delete</a></td>
</tr>
<?php
}
}
?>
</table>
<?php
if($_GET['a'] == "categories") {
// show the categories
?>
<table class="list">
<tr class="listHead">
<td>id</td><td>title</td><td>description</td><td>section</td><td>access</td><td>edit</td><td>delete</td>
</tr>
<?php
$query = mysql_query("SELECT * FROM cms_categories");
while($row = mysql_fetch_array($query)) {
// search for the forum id
$sql = mysql_query("SELECT * FROM cms_forums WHERE (id LIKE '" . $row['forum'] . "')");
while($f = mysql_fetch_array($sql)) {
?>
<tr class="listData">
<td><?=$row['id']; ?></td><td><a href="/forums.php?f=<?=$row['id']; ?>" target="_blank"><?=substr(stripslashes($row['title']), 0, 50); ?></a></td><td><a href="forums.php?func=edit&category=<?=$row['id']; ?>" target="_blank"><?=substr(stripslashes($row['description']), 0, 50); ?></a></td><td><a href="?func=edit&section=<?=$row['forum']; ?>"><? print $f['title']; ?></a></td><td>
<?php
$pgs = $row['access'];
if ($pgs == "1") {
echo "regular users";
}
if ($pgs == "2") {
echo "rostered members";
}
if ($pgs == "3") {
echo "moderators";
}
if ($pgs == "4") {
echo "administrators";
}
if ($pgs == "0") {
echo "disabled users";
}
?>
</td>
<td><a href="?func=edit&category=<?=$row['id']; ?>">edit</a></td><td><a href="?func=delete&category=<?=$row['id']; ?>" onclick="return confirm('Are you sure you want to delete section <?=$row['title']; ?>?')">delete</a></td>
</tr>
<?php
}
}
}
?>
</table>
<?php
if($_GET['a'] == "topics") {
// show the topics
?>
<table class="list">
<tr class="listHead">
<td>id</td><td>title</td><td>post</td><td>date</td><td>category</td><td>edit</td><td>delete</td>
</tr>
<?php
$query = mysql_query("SELECT * FROM cms_topics ORDER BY date DESC");
while($row = mysql_fetch_array($query)) {
// search for the category id
$sql = mysql_query("SELECT * FROM cms_categories WHERE (id LIKE '" . $row['category'] . "')");
while($f = mysql_fetch_array($sql)) {
?>
<tr class="listData">
<td><?=$row['id']; ?></td><td><a href="/forums.php?t=<?=$row['id']; ?>" target="_blank"><?=substr(stripslashes($row['title']), 0, 38); ?></a></td><td><a href="forums.php?func=edit&topic=<?=$row['id']; ?>" target="_blank"><?=substr(stripslashes($row['post']), 0, 38); ?></a></td><td><?=date("m/d/y", $row['date']); ?></td><td><?=$f['title']?></td>
<td><a href="?func=edit&topic=<?=$row['id']; ?>">edit</a></td><td><a href="?func=delete&topic=<?=$row['id']; ?>" onclick="return confirm('Are you sure you want to delete topic <?=$row['title']; ?>?')">delete</a></td>
</tr>
<?php
}
}
}
?>
</table>
<?php
if($_GET['a'] == "posts") {
// show the posts
?>
<table class="list">
<tr class="listHead">
<td>id</td><td>date</td><td>user</td><td>post</td><td>edit</td><td>delete</td>
</tr>
<?php
$query = mysql_query("SELECT * FROM cms_posts ORDER BY date DESC");
while($row = mysql_fetch_array($query)) {
// search for the user id
$user = mysql_query("SELECT * FROM cms_users WHERE (id LIKE '" . $row['author'] . "')");
while($u = mysql_fetch_array($user)) {
?>
<tr class="listData">
<td><?=$row['id']; ?></td><td><?=date("m/d/y", $row['date']); ?></td><td><a href="/user.php?id=<?=$row['author']?>" target="_blank"><?=$u['username']?></a></td><td><a href="forums.php?func=edit&post=<?=$row['id']; ?>" target="_blank"><?=substr(stripslashes($row['post']), 0, 38); ?>...</a></td>
<td><a href="?func=edit&post=<?=$row['id']; ?>">edit</a></td><td><a href="?func=delete&post=<?=$row['id']; ?>" onclick="return confirm('Are you sure you want to delete this post?')">delete</a></td>
</tr>
</table>
<?php
}
}
}
break;
case "edit":
if(isset($_GET['section']) || is_numeric($_GET['section'])) {
// match the section we want to edit
?>
<table>
<?php
$query = mysql_query("SELECT * FROM cms_forums WHERE id = '".$_GET['section']."'");
$row = mysql_fetch_array($query);
?>
<td class="fieldTitle">title</td>
</tr>
<tr>
<td class="inputData"><input class="text" type="text" name="title" value="<?=$row['title']; ?>" /> </td>
<tr>
<td class="inputData" id="buttons"><input type="submit" value="Edit Section" name="add_submit" /></td>
</tr>
<?php
}
if($_POST['add_submit']) {
mysql_query("UPDATE cms_forums SET title = '".$_POST['title']."' WHERE 'id' = ".$_GET['section']."") or die("Unable to update database.");
echo "<em>Successfully updated forum section to ".$_POST['title'].".</em>\n";
} else {
echo "<em>Error updating item</em><br /><br />".mysql_error()."\n";
}
break;
}
}
?>