Linked Questions

Popular Questions

Two database connection in one query in Laravel

Asked by At

I need to use INSERT INTO...SELECT but using two different database in Laravel. Database A is a local database. Database B is a remote database.

I need something like this :

INSERT INTO local.table1
SELECT * 
FROM remote.table1
ON DUPLICATE KEY UPDATE col1=col1

Is there any way I could achieve this in laravel? Thanks!

Related Questions