Re: UPDATE Not Updating

From: Date: Fri, 03 Aug 2001 13:39:37 +0000
Subject: Re: UPDATE Not Updating
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-11025@lists.php.net to get a copy of this message
I echoed out the $update_contact_sql and I'm getting FirstName='Value', etc. WHERE ContactID='' There is no value in ContactID. I've changed the double quotes to single quotes and dropped the quotes all together with $ContactID. I ran the query in MySQL client and gave the ContactID a value which worked fine. I'm not sure why the query string is not passing the value. "Steve Fitzgerald" <sf@mnetsys.com> wrote in message news:20010801212400.29901.qmail@pb1.pair.com... > I belive this UPDATE should work, but it isn't. I get no errors. I have also > tried using FieldName= '$Fieldname', but that does not seem to work either. > > > > $table_name = "contacts"; > > > $update_contact_sql = "UPDATE $table_name > SET > FirstName =\"$FirstName\", > LastName = \"$LastName\", > Title = \"$Title\", > WorkPhone = \"$WorkPhone\", > HomePhone = \"$HomePhone\", > Mobile = \"$Mobile\", > EmailName = \"$EmailName\", > Birthday = \"$Birthday\" > WHERE ContactID = \"$ContactID\" > "; > > > $result = @mysql_query($update_contact_sql, $connection) or die ("Couldn't > execute query."); > >

« previous php.db (#11025) next »