I know I can assign 2 databases through codeigniter. Is there a way to tell the query tags which database to pull the information from? I'm having to pull data from an external database.

2 Answers 2


The only way I was able to do this was with PHP in the template and using a mysql_select_db to switch the database. If you didn't want to use PHP in the template itself then I would think that would be fairly straightforward to code up as a plug in.


No. EE is set-up to check a single database. But you can add additional tables to that database as you see fit, and use QUERY module to access data out of them. For example, when we add custom tables to a solution for a client, we've done things like zip_code, counties, irs_data, etc. We use a prefix other than exp and add them to the same database. You don't need the prefix, but it will keep the tables grouped together. So say, mnd_zipcodes, mnd_regions, mnd_counties, mnd_form_990s, etc.

That works well. We've also run secondary apps on the same database, using different prefixes. You may end up with a lot of tables, but EE's QUERY can access any of the tables.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.