RE: [PHP] Mucking about with Variables

From: Date: Thu, 03 Aug 2000 16:58:35 +0000
Subject: RE: [PHP] Mucking about with Variables
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-9980@lists.php.net to get a copy of this message
> -----Original Message----- > From: root [mailto:root]On Behalf Of callen > Sent: Thursday, August 03, 2000 11:32 AM > To: PHP General List > Subject: [PHP] Mucking about with Variables > > > $query= "UPDATE ticketing SET $var = $var where ticket_number = > '$ticket_id' "; > > This statemnet gets passed fine into mysql with no errors, but > unfortuantely no data is inserted > into the DB. When I quote $var, I get syntax errors, so.... > > Whats wrong with this statement?? What is the value of $var at the time? Is there, in fact, a column in your table by that name? Have you tried echoing the value of $query to make sure it's getting built the way you expected? The mysql_error() function is awfully handy for troubleshooting when queries are failing. http://www.php.net/manual/function.mysql-error.php --- Mark Roedel | "Blessed is he who has learned to laugh Systems Programmer | at himself, for he shall never cease LeTourneau University | to be entertained." Longview, Texas, USA | -- John Powell

« previous php.general (#9980) next »