Title: SQL for another database
Last modified: August 30, 2016

---

# SQL for another database

 *  Resolved [tashword](https://wordpress.org/support/users/tashword/)
 * (@tashword)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/sql-for-another-database/)
 * Hi Eli,
 * I had this working perfectly on our test site but am now having trouble on our
   real site. I know next to nothing about MySQL so apologies if I use incorrect
   terms.
 * basically I need to get the code to refer to another database – ie it is on the
   same hosting and in the same MySQL but is not part of the WP database.
 * When I create a report, the list of folders does not show the relevant fields
   to choose. I tried entering the required table name in the code that shows in‘
   create a report’ but it didn’t work.
 * Can I direct the plugin to that other database somehow? If not, can I migrate
   the other database into the plugin’s view (very nervous asking that one!)?
 * Thanks,
 * Tash
 * [https://wordpress.org/plugins/elisqlreports/](https://wordpress.org/plugins/elisqlreports/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Eli](https://wordpress.org/support/users/scheeeli/)
 * (@scheeeli)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/sql-for-another-database/#post-6283259)
 * You can use this plugin to write a query for any table in active WordPress database.
   It is not current possible within this plugin to query tables from another database.
 * The easiest solution would be to import the tables you need to access into the
   database where your WordPress is already installed.
 * Aloha, Eli
 *  Thread Starter [tashword](https://wordpress.org/support/users/tashword/)
 * (@tashword)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/sql-for-another-database/#post-6283332)
 * Thanks Elis.
 * I copied across the database and the plugin is working perfectly now. Thanks 
   again,
 * Tash

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘SQL for another database’ is closed to new replies.

 * ![](https://ps.w.org/elisqlreports/assets/icon-256x256.png?rev=1231385)
 * [EZ SQL Reports Shortcode Widget and DB Backup](https://wordpress.org/plugins/elisqlreports/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/elisqlreports/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/elisqlreports/)
 * [Active Topics](https://wordpress.org/support/plugin/elisqlreports/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/elisqlreports/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/elisqlreports/reviews/)

## Tags

 * [code](https://wordpress.org/support/topic-tag/code/)
 * [database](https://wordpress.org/support/topic-tag/database/)
 * [MySQL](https://wordpress.org/support/topic-tag/mysql/)

 * 2 replies
 * 2 participants
 * Last reply from: [tashword](https://wordpress.org/support/users/tashword/)
 * Last activity: [10 years, 11 months ago](https://wordpress.org/support/topic/sql-for-another-database/#post-6283332)
 * Status: resolved