[EMAIL PROTECTED] wrote:
I want to update a table if it meets some conditions (already exist) and INSERT otherwise?

Right now I am doing it this way:

1. SELECT the record
2. If it exist, I UPDATE it
3. If it does not exit, I INSERT a new record

Could this be done in one query? I mean like conditional update/insert?

Take a look at REPLACE:

http://dev.mysql.com/doc/refman/5.0/en/replace.html


--
David Precious
http://blog.preshweb.co.uk/

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to