MySQL Forums
Forum List  »  PHP

Re: html,mysql,php copy data from one db to another
Posted by: Barry Galbraith
Date: June 01, 2012 06:45PM

>I need to take that data and if the row already exists in my second table, update the corresponding row and if not, insert a new row with the data.

Take a look at the syntax for INSERT .. ON DUPLICATE KEY UPDATE

http://dev.mysql.com/doc/refman/5.5/en/insert-on-duplicate.html

Also, have you considered replication as means of getting the second server to mirror the first? Or do updates get done to both servers?

Good luck,
Barry.

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.