• Terrence LP

    (@terrence-lp)


    Hello,

    I would like to know if I can ‘USE’ a different DB for displaying custom data. The Table tab sees this table and that part works. But I need a custom query and doing this on the Query tab produces errors.

    How can I access the non WordPress db?

Viewing 4 replies - 1 through 4 (of 4 total)
  • rweil55

    (@rweil55)

    try

    “WP_Tables does not directly support custom SQL queries, However if you use phpMyAdmin to create a view, then WP_Tables can display that view.”

    Plugin Author Ian Sadovy

    (@iansadovy)

    Hello @terrence-lp,

    Thank you for the question.
    To run the query for the different databases on the server, please make sure that the MySQL user for wordpress db also has read permissions for other databases you want to access. It can be done by using PhpMyAdmin or GRANT statement.

    Hope it helps.

    Regards,
    Ian

    Thread Starter Terrence LP

    (@terrence-lp)

    Hello,

    Great Plugin – Needs a Filter feature! Like Filter By (what ever we have in the columns)

    But to answer the ‘USE DB’ what I was able to do was set up MySQL permissions so my WP User also has access to the other or External DB.

    From there I just call the DB like so –

    SELECT article.id, SUM(article_text.word_count) as total_words
    FROM master_media.article

    As long as that is specified it all works great!

    I’m even using SUM, JOINS, GROUP BY and ORDER BY’s all in the same query and works great .

    Plugin Author Ian Sadovy

    (@iansadovy)

    Hello @terrence-lp,

    I am glad to hear it works.
    As for the filtering feature, I see many requests for that, so I will try to prioritize the development.

    Thanks,
    Ian

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘SQL USE DB’ is closed to new replies.