Hi,
reading your post I assume that you have something like
<form action="form.php?action=add" method="POST">
Try to change it to:
<form action="form.php" method="POST">
<input type="hidden" name="action" value="add" />
Then use $POST['action'] instead of $GET['action'].
If the form has several submit buttons (e.g. one for add and one for delete) the do something like:
<form action="form.php" method="POST">
....some form elements....
<input type="submit" name="delete" value="delete stuff..." />
<input type="submit" name="add" value="add stuff...." />
</form>
// in form.php
if (isset($_POST['add'])) {
// add data
} else if (isset($_POST['delete'])) {
// delete data
}
If the method of the form is GET you need to use $GET again instead of $POST.
Additionally, add mysql_error to the mysql_query line like suggested by Shrike, e.g.
mysql_query($query) or die("SQL error: ".mysql_error());
Thomas