Need my SQL to update on existing...

ok, it's simple, I have this sql statement, and I want it to update "ON DUPLICATE KEY"... the two tables are identical so the easiest is best :)

$sql = "INSERT lapa_backups.2_transaction_tmp SELECT * FROM 2_transaction";
Who is Participating?
Guy Hengel [angelIII / a3]Connect With a Mentor Billing EngineerCommented:
have you already checked the document?

$sql = "INSERT lapa_backups.2_transaction_tmp SELECT * FROM 2_transaction ON DUPLICATE KEY UPDATE somefield = somevalue;";
Jinesh KamdarCommented:
Shouldn't that be an INSERT INTO lapa_backups.2_transaction_tmp ....
The INTO keyword is missing there.
All Courses

From novice to tech pro — start learning today.