RE: [PHP] How to UPDATE only certain fields
| From: | Sævar Öfjörð | Date: | Thu, 19 Jun 2003 23:20:24 +0000 |
| Subject: | RE: [PHP] How to UPDATE only certain fields | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-152257@lists.php.net to get a copy of this message | ||
The right SQL syntax would be:
UPDATE $table SET type='$type', year='$year' WHERE id='$id';
Sævar - ICELAND
-----Original Message-----
From: Matt Hedges [mailto:matt@hedges.org]
Sent: 19. júní 2003 23:07
To: php-general@lists.php.net
Subject: [PHP] How to UPDATE only certain fields
Hello,
I am building an database of wines. I have fields of stuff like year,
grape, etc. However, I want to be able to go in and change something
without having to retype every field. As I have it right now, I use the
UPDATE where id=$id function. However, this changes EVERY field. For
example, if I want to only change the grape field and leave everything
else
the same (so I thus leave those fields blank) it overwrites the others
with
a blank field.
Is there anyway to where if it reads a blank field instead of deleting
the
old information, the update php file just leaves it the same?
thanks very much for any help,
Matt Hedges
--
___________________________
| Matt Hedges
| http://hedgesinnovations.com
|
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php