Re: Update query
| From: | Jason Wong | Date: | Thu, 12 Dec 2002 21:40:21 +0000 |
| Subject: | Re: Update query | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-128073@lists.php.net to get a copy of this message | ||
On Thursday 12 December 2002 18:48, Steve Jackson wrote:
> It doesn't work in that it doesn't update the database.
> I have a form which when loaded takes a variable ItemCode from the
> previous page (which gets the Itemcode from the DB) and puts it into a
> hidden field which I call oldItemCode, then when I try to update the
> $ItemCode row in the database with the edited changes using the
> oldItemCode as an identifier it won't update - It goes to my error
> message shown below. So what I'm asking is there anything I'm doing
> wrong. I noted your points about the comma and have changed the code.
>
> <?
> $query = "update products
> set ItemCode='$ItemCode',
> ItemName ='$ItemName',
> catid ='$catid',
> price = '$price',
> description = '$description',
> shortdesc = '$shortdesc',
> where ItemCode='$oldItemCode'";
> $result = mysql_query($query);
You've got an extra comma after '$shortdesc' which you should remove.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
/*
Conscious is when you are aware of something and conscience is when you
wish you weren't.
*/