Re: mysql update query
| From: | David Robley | Date: | Wed, 05 Dec 2001 03:37:55 +0000 |
| Subject: | Re: mysql update query | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-76640@lists.php.net to get a copy of this message | ||
On Wed, 5 Dec 2001 13:57, Greg Sidelinger wrote:
> 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
Note that you do not put single quotes around the values you assign to
non-char type fields.
It is useful to use mysql_error() after a call to the db where you
encounter problems.
--
David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA
"What's the value of a dollar bill?" asked Tom noteworthily.