RE: [PHP] mysql update query
| From: | Lawrence dot Sheed at dfait-maeci dot gc dot ca | Date: | Wed, 05 Dec 2001 04:04:58 +0000 |
| Subject: | RE: [PHP] mysql update query | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-76646@lists.php.net to get a copy of this message | ||
I concur
Probably this will work
$result = mysql_query("UPDATE table SET value1='$value1',value2='$value2'
WHERE id=$id");
remember integers id=1 are not strings id='1'; not the same!
-----Original Message-----
From: Martin Towell [mailto:martin.towell@world.net]
Sent: December 5, 2001 11:37 AM
To: 'Tyler Longren'; Greg Sidelinger; php-general@lists.php.net
Subject: RE: [PHP] mysql update query
are any of the fields of type number/integer/etc? if so, try removing the
quotes for that field.
-----Original Message-----
From: Tyler Longren [mailto:tyler@captainjack.com]
Sent: Wednesday, December 05, 2001 2:36 PM
To: Greg Sidelinger; php-general@lists.php.net
Subject: Re: [PHP] mysql update query
Everything looks good to me...try this:
$result = mysql_query("UPDATE table SET value1='$value1',value2='$value2'
WHERE id='$id'");
Although I doubt MySQL cares if certain words are capitalized.
Good luck though,
Tyler Longren
----- Original Message -----
From: "Greg Sidelinger" <gate@psu.edu>
To: <php-general@lists.php.net>
Sent: Tuesday, December 04, 2001 9:27 PM
Subject: [PHP] mysql update query
> I'm having trouble getting an update query to work
>
> Here is what I'm doing
>
> $result = mysql_query("update table set value1='$value1',
> value2='$value2' where id='$id'");
>
> It is not updating the database. All the $vars have values and I'm
> using the correct columns names. Could someone please point me in the
> correct direction because I have been trying different things for a
> while but can't seem to get it to work.
>
> Greg
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net