Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Change database prefix (connection) on the fly

SS ✭✭
edited March 2010 in Vanilla 2.0 - 2.8
I want make model (database) or perhaps sqldriver which will do quries for old database of old site with advantages of Garden cha

How is better to do that?
Now I use this construction (in some model)
public function OldGetID(){ Gdn::Database()->DatabasePrefix = 'olddb.oldprefix_'; $Result = $this->SQL ->Select() ->From('old_table t1') ->Join('old_table2 t2') ->Get(); Gdn::Database()->DatabasePrefix = Gdn::Config('Database.DatabasePrefix'); return $Result; }

Any other solutions?


I cant do Put() chain queries...

Comments

Sign In or Register to comment.