Updating non-existant records...

2001-05-29 Thread Randolpho St John

Hello all. I'm new to the list, and I just have a quick question.
Hopefully somebody can help me out.

Anyway, here's the basics of what I want to do:

I want to update a record or, if that record does not exist, create a
new one.

Now I could easily do this on the client side in another language, but
it would require a query or two to the MySQL server as a test. This
update is something that will be done very frequently, and I would like
to limit the number of queries if at all possible -- I'd rather have the
SQL server do the test.

So... is there any way to do it in MySQL?

Thanks to any replies,
Randolpho


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Updating non-existant records...

2001-05-29 Thread Eric Persson

Randolpho St John wrote:
 
 Hello all. I'm new to the list, and I just have a quick question.
 Hopefully somebody can help me out.
 
 Anyway, here's the basics of what I want to do:
 
 I want to update a record or, if that record does not exist, create a
 new one.
Try the REPLACE... query. Look in the manual. 
Its quite handy to use replace. =)

//Eric

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php