You're still not reporting any errors from the database. In a larger project you'd be utterly clueless. PHP isn't going to give you errors from your SQL syntax unless those errors cause errors in your PHP syntax.
Code:
if(isset($_POST['remove'])){
$query = "DELETE FROM faculty_mailing_list WHERE id=id";
$result = mysql_query($query);
}
So if you say where id=id its more or less the same thing as not having a WHERE clause at all. In fact, I think your entire logic is off.
You're going to probably want to be able to delete more than one row at once. On page 1 output something like this:
// DB stuff here, make a loop and output every id to a checkbox field.
$result = mysql_query("SELECT id, field, field2 FROM table");
while ($data = mysql_fetch_array($result))
{
echo "<input type='checkbox' name='id[]' value='$the_id'>$the_id</input><br />";
}
// Then add a button later..
<input type='submit' name='remove' value='Delete' />
If you'll notice I'm using empty bracket notation in the name of the checkbox field, when this gets to PHP it'll create a multidiminsional array.
if (isset($_POST['remove']))
{
foreach ($_POST['id'] as $the_id)
{
if (!mysql_query("DELETE FROM table WHERE id = '$the_id'"))
{
echo mysql_error();
}
}
}
And there you have it. foreach will iterate through the $_POST['id'] array, extracting the value, that value is then passed to a mysql_query where that record is deleted.
Regards,
Rich
::::::::::::::::::::::::::::::::::::::::::
The Spicy Peanut Project
http://www.spicypeanut.net
::::::::::::::::::::::::::::::::::::::::::