I can't figure out why when i go to submit this form to update the table it won't do anything, anyone got any ideas?
$getCategory = mysql_query("select * from $categoryTable where cid = " . $_GET['cid']);
$category = mysql_fetch_assoc($getCategory);
echo "<h2>Edit a Category</h2>\n";
echo "<form action=\"edit_category.php\" method=\"post\">\n";
echo "<input type=\"hidden\" name=\"cid\" value=" . $_GET['cid'] . ">\n";
echo "<table>\n";
echo "<tr>\n";
echo "\t<td>Name</td>\n";
echo "\t<td><input type=\"text\" name=\"name\" value=\"" . $category['name'] . "\"></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "\t<td>Description</td>\n";
echo "\t<td><textarea name=\"description\" cols=50 rows=5>" . $category['description'] . "</textarea></td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "\t</td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "<input type=\"submit\" name=\"saveChanges\" value=\"Save Changes\">\n";
echo "</form>\n";
}
if (isset($post_saveChanges)) {
$name = addslashes($post_name);
$description = addslashes($post_description);
if (@mysql_query("update $categoryTable set name = '$name', description = '$description' where cid = $post_cid")) {
echo "<h2>Category updated</h2>\n";
echo "<p><a href=\"edit_category.php\">Edit another category</a>.</p>\n";
}
else {
echo "<h2>Error</h2>\n";
echo "<p>MySQL reported the following error while trying to update category ID# <b>$post_cid</b>: " . mysql_error() . "</p>\n";
}
}