Inserting a variable into a mysql_query() statement
| From: | Phil Clark | Date: | Tue, 15 Oct 2002 04:54:34 +0000 |
| Subject: | Inserting a variable into a mysql_query() statement | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-119982@lists.php.net to get a copy of this message | ||
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.)