Re: Inserting a variable into a mysql_query() statement
| From: | Marek Kilimajer | Date: | Wed, 16 Oct 2002 09:47:19 +0000 |
| Subject: | Re: Inserting a variable into a mysql_query() statement | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-120154@lists.php.net to get a copy of this message | ||
You very likely need to use $_REQUEST[hidden_manuf_id] in your first example, which is almost correct otherwise( for security reasons, also put single quotes around it)
Phil Clark wrote:
I'm trying to insert the variable $hidden_manuf_id into a mysql_query() statement. If i do this: mysql_query("DELETE FROM product WHERE manufacturer=$hidden_manuf_id",$bb) or die(mysql_error()); PHP server doesn't see the variable because it is inside the string quotes"". If I do this: mysql_query("DELETE FROM product WHERE manufacturer="$hidden_manuf_id,$bb) or die(mysql_error()); PHP server reports a parsing error. What is the correct syntax? ($bb is correctly defined.)