WordPress.org

Ready to get started?Download WordPress

Forums

connect to external db from page (3 posts)

  1. water
    Member
    Posted 8 years ago #

    is it possible to connect to extaernal databases from a wordpress page using exec_php?

    i gave it a very quick try but got an error that told me that it was looking for the tables in the wp database and not the external one.

    :water

  2. water
    Member
    Posted 8 years ago #

    to clarify my post above, my goal is to query another database than the wordpress database and print a list of gigs like on this page : http://www.werock.org/live.php

    if this turns out to work to my liking i'm going to seriously consider migrating the whole http://www.werock.org site to wordpress.

    :torgeir

  3. davidchait
    Member
    Posted 8 years ago #

    create custom page template with your custom db code.
    create new WP Page, select custom page template.

    should work.

    the PHP execution plugins should all reasonably be able to do this too. I use my CG-QuickPHP to include a file into a page, or call a single function, when I just have one quick thing to do... Otherwise, I use custom page templates -- just easier to manage complex code rather than embedded into a page/post.

    -d

Topic Closed

This topic has been closed to new replies.

About this Topic