Re: Re: UPDATE Not Updating
| From: | Andreas D. Landmark | Date: | Fri, 03 Aug 2001 14:11:24 +0000 |
| Subject: | Re: Re: UPDATE Not Updating | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-11036@lists.php.net to get a copy of this message | ||
At 03.08.2001 14:39, 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.Firstly the reason it doesn't give any error back is because you've got the @ in there... @ infront of a function suppresses any error being sent to the user. You didn't say whether $ContactID is local to the function or not, if it's outside the function's namespace you would obviously not be able to use it inside the function. What does echo $ContactID give you? btw. don't munge output next time, it would have been much clearer if you'd just copied the output from echo $update_contact_sql as it was in your browser than trying to shorten it (and hence obfuscating it).
"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-- Andreas D Landmark / noXtension Real Time, adj.: Here and now, as opposed to fake time, which only occurs there and then.