Hey All,

I can't for the life of me figure out why this script won't delete an entry. When I click the delete link, I receive the message that entry has been deleted, but a check of the mysql table shows it still being there. Can anyone help?

Here is the code:

PHP Code:
//Define Global Variables
$submittask $_POST['submittask'];
$brand $_POST['brand'];
$item $_POST['item'];
$size $_POST['size'];
$color $_POST['color'];
$imgloc $_POST['imgloc'];
$imgname $_POST['imgname'];
$request $_POST['request'];
$category $_POST['category'];
$comments $_POST['comments'];
$ID $_POST['ID'];
$deletetask $_POST['deletetask'];

     if (isset(
$_REQUEST['addtask'])): // If the user wants to add a task
    <form action="<? echo $PHP_SELF ?>" method="post">
        <table width="100%">
          <tr id="grey"> 
            <td id="leftcolumn">Type Of Request</td>
            <td><select name="request">
                <option selected="selected">Type of Request</option>
                <option value="addproduct">Add New Product</option>
                <option value="changestatus">Change Status</option>
                <option value="removeproduct">Remove Product</option>
            <td id="leftcolumn">Category: </td>
            <td><select name="category">
                <option selected="selected">Choose A Category</option>
                <option value="Shoes">Shoes</option>
                <option value="Decks">Decks</option>
                <option value="Trucks">Trucks</option>
                <option value="Wheels">Wheels</option>
                <option value="Apparel">Apparel</option>
                <option value="Bags">Bags</option>
                <option value="Acessories">Accessories</option>
                <option value="Videos">Videos</option>
                <option value="FTC">FTC</option>
                <option value="Blowout">Blowout</option>
          <tr id="grey"> 
            <td id="leftcolumn">Brand:</td>
            <td><input name="brand" type="text" />
              (ex. </td>
            <td id="leftcolumn">Item:</td>
            <td><input name="item" type="text" /></td>
          <tr id="grey"> 
            <td id="leftcolumn">Size:</td>
            <td><input name="size" type="text" /></td>
            <td id="leftcolumn">Color:</td>
            <td><input name="color" type="text" /></td>
          <tr id="grey"> 
            <td id="leftcolumn">Image Location</td>
            <td><input name="imgloc" type="text" /></td>
            <td id="leftcolumn">Image Filename:</td>
            <td><input name="imgname" type="text" id="imgname" /></td>
          <tr id="grey"> 
            <td id="leftcolumn">Additional Comments:</td>
            <td><textarea name="comments" cols="40" rows="10"></textarea></td>
          <tr id="grey"> 
            <td id="leftcolumn"><input type="submit" name="submittask" value="SUBMIT" /></td>
else: // Default page display
        // Connect to the database server
$dbcnx = @mysql_connect("localhost""root""********");
        if (!
$dbcnx) {
"<p>Unable to connect to the database server at this time.</p>" );
// Select the news database
if (! @mysql_select_db("test") ) {
"<p>Unable to locate the database at this time.</p>" );
// If a story has been submitted,
        // add it to the database.
if ($submittask == "SUBMIT") {
$sql "INSERT INTO tasks SET
        if (@
mysql_query($sql)) {
"<p>Your task has been added.</p>");
        } else {
"<p>Error adding submitted task: " .
mysql_error() . "</p>");
//If A Task Has Been Deleted
if (isset($_REQUEST['deletetask'])) {
$sql "DELETE FROM tasks WHERE ID='$taskid'";
            if (@
mysql_query ($sql) ) {
                echo (
"<p>Task Has Been Deleted.</p>");
            else {
                echo (
"<p>Error Deleting Task. Please Try Again.</p>");
"<p> Here are all the requests in our database: </p>");
// Request the text of all the stories
$result = @mysql_query("SELECT ID, category, item, request FROM tasks");
        if (!
$result) {
"<p>Error performing query: " mysql_error() . "</p>");
// Display the text of each story in a paragraph
echo ("<table width='90%'>");
        echo (
"<tr bgcolor='#999999'> 
                <td width='10%'><div align='center'><font color='#FFFFFF'><strong><font size='1' face='Verdana, Arial, Helvetica, sans-serif'>Task ID</font></strong></font></div></td>
                <td width='20%'><div align='center'><font color='#FFFFFF'><strong><font size='1' face='Verdana, Arial, Helvetica, sans-serif'>Category</font></strong></font></div></td>
                <td width='30%'><div align='center'><font color='#FFFFFF'><strong><font size='1' face='Verdana, Arial, Helvetica, sans-serif'>Item</font></strong></font></div></td>
                <td width='20%'><div align='center'><font color='#FFFFFF'><strong><font size='1' face='Verdana, Arial, Helvetica, sans-serif'>Type</font></strong></font></div></td>
                <td width='20%'><div align='center'><font color='#FFFFFF'><strong><font size='1' face='Verdana, Arial, Helvetica, sans-serif'>Remove</font></strong></font></div></td>
        while ( 
$row mysql_fetch_array($result) ) { 
$taskid $row["ID"];
//End PHP ?>
                    <td align="center"><? echo ( $row['ID'] ); ?></td>
                    <td align="center"><? echo ( $row['category'] ); ?></td>
                    <td align="center"><? echo ( $row['item'] ); ?></td>
                    <td align="center"><? echo ( $row['request'] ); ?></td>
                    <td align="center"><? echo ("<a href='$PHP_SELF?deletetask=$taskid'>delete task</a></td>");?>
        echo (
// When clicked, this link will load this page
        // with the news submission form displayed.
echo("<p><a href=$PHP_SELF?addtask=1>Add a New Task</a></p>");
As always, thanks for the help...