Re: Re: UPDATE Not Updating

From: Date: Fri, 03 Aug 2001 13:57:05 +0000
Subject: Re: Re: UPDATE Not Updating
References: 1 2  Groups: php.db 
Request: Send a blank email to php-db+get-11029@lists.php.net to get a copy of this message
$ContactID is not set - prove it by trying: echo $ContactID before your query statement is built. Once you know that $ContactID is not set, you can track down why that's the case. Chris Steve Fitzgerald wrote: > > 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."); > > > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net -- Chris Hobbs Silver Valley Unified School District Head geek: Technology Services Coordinator webmaster: http://www.silvervalley.k12.ca.us/~chobbs/ postmaster: chobbs@silvervalley.k12.ca.us

« previous php.db (#11029) next »