on 5/20/01 11:50 AM, Matthew Tyler at [EMAIL PROTECTED] 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/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]