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" <[EMAIL PROTECTED]> wrote in message
> I belive this UPDATE should work, but it isn't. I get no errors. I have
> tried using FieldName= '$Fieldname', but that does not seem to work
> $table_name = "contacts";
> $update_contact_sql = "UPDATE $table_name
> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to