Re: won't delete
| From: | Doug Thompson | Date: | Tue, 08 Apr 2003 16:32:09 +0000 |
| Subject: | Re: won't delete | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-26933@lists.php.net to get a copy of this message | ||
Most likely, you need to enclose $id in single quotes so that mysql recognizes it as a character
string.
$sql = "DELETE FROM emails WHERE id='$id'"
Less likely, you don't have delete privileges.
Doug
--Original Message Text---
From: Cameron Showalter
Date: Tue, 8 Apr 2003 09:10:38 -0700
Hello,
With the following script, I am able to enter data, but I cannot modify or
delete data, no errors, it just does nothing. obviously I'm missing
something, but I don't know what.
thanks in advance.
Cameron
"; } elseif ($delete) { $sql = "DELETE FROM emails WHERE id=$id"; $result =
mysql_query($sql); echo "$sql Record deleted!
"; } else { if (!$id) { $result = mysql_query("SELECT * FROM emails",$db); while
($myrow = mysql_fetch_array($result)) { printf("%s %s \n", $PHP_SELF,
$myrow["id"], $myrow["first"], $myrow["last"]); printf("(DELETE)
", $PHP_SELF, $myrow["id"]); } } ?>
">ADD A RECORD
"> "> First name:">
Last name:">
email:">
store:">
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php