On Tuesday 15 October 2002 12:54, Phil Clark wrote:
> I'm trying to insert the variable $hidden_manuf_id into a mysql_query()
> If i do this:
> mysql_query("DELETE FROM product WHERE manufacturer=$hidden_manuf_id",$bb)
> or die(mysql_error());
That should work iff manufacturer is a number. Otherwise you need
"DELETE FROM product WHERE manufacturer='$hidden_manuf_id'"
> PHP server doesn't see the variable because it is inside the string
Actually you DO need the double-quotes in order for PHP interpret
$hidden_manuf_id as a variable.
What you really should do is split the above into two steps:
$query = "DELETE FROM product WHERE manufacturer=$hidden_manuf_id";
mysql_query($query, $bb) or die("Error in $query :: " . mysql_error());
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
Check me if I'm wrong, Sandy, but if I kill all the golfers...
they're gonna lock me up and throw away the key!
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php