Re: Deleting specific records from MySQL tables
| From: | Paul Burney | Date: | Sun, 20 May 2001 21:04:12 +0000 |
| Subject: | Re: Deleting specific records from MySQL tables | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-9481@lists.php.net to get a copy of this message | ||
on 5/20/01 11:50 AM, Matthew Tyler at matt@df-studios.com wrote:
> I'm having difficulty getting certain records in MySQL tables to delete. I
> have this bit of code:
>
> mysql_db_query("phpads", "DELETE FROM adviews WHERE
> bannerID=$banresult[bannerID]");
I don't think that PHP will be able to interpret the array notation within
the double quotes. Try this instead:
mysql_db_query("phpads", "DELETE FROM adviews WHERE bannerID=" .
$banresult[bannerID]);
Or to be more clear:
$this_query = 'DELETE FROM adviews WHERE bannerID=' . $banresult[bannerID];
mysql_db_query("phpads", $this_query);
If the bannerID field isn't numeric, you'll need to enclose it in quotes as
someone else mentioned.
HTH,
Paul Burney
http://paulburney.com/
http://webdevel.burney.ws/