Quote from: pixelchutes at Sep 18, 2007, 11:13 PM Actually, yes, you can use the DBAPI for alternate DB access.
Check the wiki here: http://wiki.modxcms.com/index.php/Access_another_database_from_MODx
Sorry to dig an old post here, but I am currently looking into using eForm2db with an alternate DB.
I have read the wiki’s article, and my take on it was that the snippet would have to cover 3 cases :
1) use the MODx DB : the current snippet code covers that
2) use an alternate DB on the same server
3) use an alternate DB on a different server.
As you might know, my php skills are very beginner-ish so to speak... how would you go about this : my thought was, create a parameter to set this directly in the snippet call (e.g [!eForm2db? &db=`same` ..... !]).
Quote from: pixelchutesEssentially, database_2.table_name does the trick!
Does this mean that I just need to add those at the beginning of the snippet ?
* Different Database, Same Server :
[tt]$ds = $modx->db->select(’*’,’database_name.table_name’);[/tt]
* Different Database, Different Server :
[tt]$db = new DBAPI($host,$database, $uid,$pwd);
$ds = $db->select(’*’,’table_name’);[/tt]
Thanks for any pointer, which could help me get started