Connect to other database (5.7)

Permalink 2 users found helpful
Hello,

I have created a custom form. The result of the form needs to be written to another database. How is this achieved?

In Concrete 5.6 it was possible like this:
$db = Loader::db( 'newserver', 'newuser', 'newpassword', 'newdatabase', true);


Currently I am still writing to the site database
$db = Database::get();
//tried this
$db = Loader::db('localhost', 'root', 'root', 'db_new', true);
//error
//db_original.db_new does not exist


Thanks for the help

View Replies: View Best Answer
rge replied on at Permalink Best Answer Reply
Joe Meyer answered my question on StackOverflow:
http://stackoverflow.com/questions/30593616/concrete-5-7-switch-dat...
MrKDilkington replied on at Permalink Reply
MrKDilkington
@rge

Thank you for posting the solution on the forum.

This is useful information.