Re: delete & insert ?
| From: | Bastien Koert | Date: | Tue, 23 Jun 2009 21:04:49 +0000 |
| Subject: | Re: delete & insert ? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-294487@lists.php.net to get a copy of this message | ||
On Tue, Jun 23, 2009 at 4:20 PM, PJ<af.gourmet@videotron.ca> wrote:
> I just had a bright idea ???
> Am doing editing file for book entries; it occurs to me (now that I am
> practically finished) that it might be much simpler to delete entries
> and just insert rather than going through the rigamarole of checking if
> the new entries exist and if and if and if... just delete & insert -
> less code, less headaches... or is this a cute fantasy & I should get
> myself locked up?
> Guys, don't go overboard on this... I know I'm leaving myself wide open :-P
>
> --
> Hervé Kempf: "Pour sauver la planète, sortez du capitalisme."
> -------------------------------------------------------------
> Phil Jourdan --- pj@ptahhotep.com
> http://www.ptahhotep.com
> http://www.chiccantine.com/andypantry.php
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Try using the REPLACE statement if you are using mysql... it will
allow automatic update without the UPDATE syntax and inserts if the
key id is not there
--
Bastien
Cat, the other other white meat