Re: Update query
| From: | Jason Wong | Date: | Thu, 12 Dec 2002 09:07:36 +0000 |
| Subject: | Re: Update query | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-127967@lists.php.net to get a copy of this message | ||
On Thursday 12 December 2002 17:00, Steve Jackson wrote:
> How do you update MySQL in the following way?
> I have designed a form which has all the fields in the database
> available to edit based on a user query. The query is a field called
> $ItemCode.
>
> If the user wants to change that $ItemCode field how do I update it? In
> other words how do I use PHP to update the database row called $ItemCode
> with a new $ItemCode where $ItemCode is $ItemCode?
>
> Here is what I've tried and failed at!
Please, when something doesn't work, you got to describe _HOW_ it doesn't
work!
> $oldItemCode = $ItemCode;
> $query = "update products
> set ItemCode='$newItemCode',
> ItemName ='$ItemName',
> catid = '$catid',
> price = '$price',
> description = '$description'
> shortdesc = '$shortdesc'
> where ItemCode='$oldItemCode'";
You seem to be missing a comma after --> description = '$description'
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
/*
We all know that no one understands anything that isn't funny.
*/