RE: [PHP] Script not updating
| From: | Peter Houchin | Date: | Sun, 25 Feb 2001 23:43:17 +0000 |
| Subject: | RE: [PHP] Script not updating | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-41618@lists.php.net to get a copy of this message | ||
but that's why i've got the
if($name){ ....
if($submit) ...
clause in it .. thinking that if there was a name then update the record..
otherwise create a new one
-----Original Message-----
From: Simon Garner [mailto:sgarner@expio.co.nz]
Sent: Monday, February 26, 2001 10:36 AM
To: Peter Houchin; PHP MAIL GROUP
Subject: Re: [PHP] Script not updating
From: "Peter Houchin" <peterh@vfsa.com.au>
> Could some one please have a look thru my code and tell me why it creates
a new record instead of updating the record?
>
[snip]
>
> if ($submit){
>
> $result = mysql_query("INSERT INTO app
(name,company,address,suburb,state,post,areacode,phone,faxareacode,fax,email
,secret) VALUES
('$name','$company','$address','$suburb','$state','$post','$areacode','$phon
e','$faxareacode','$fax','$email','$secret')");
>
^^ Here's your culprit. Check your logic. Whenever they push submit it
INSERTs a new record (I think...).
Regards
Simon Garner