WordPress.org

Ready to get started?Download WordPress

Forums

Place extra tables in WP db, or separate db? (4 posts)

  1. seizethedave
    Member
    Posted 8 years ago #

    I've got a couple tables that are populated by a back-end process that will be used only by the front-end WP site. They are pretty flat and no-nonsense. Currently I have these tables in their own mysql database, but I'm starting to see that WP has some built in mechanisms for querying its own database that might be a little more efficient/wordpressy.

    Option A:
    leave tables in separate db, create an additional database connection using standard php/mysql functions and query away.

    Option B:
    put tables in WB db, use the wpdb->xxx() functions to access them.

    would love some opinions!
    /wp newb

    thanks
    david

  2. Kafkaesqui

    Posted 8 years ago #

    I would recommend the same database approach, for two reasons. First, managing separate db connections can lead to some pain, especially within a single (or collective set of) PHP document(s). Second, backing it all up together is so much easier. :)

  3. pizdin_dim
    Member
    Posted 8 years ago #

    I agree with Kafkaesqui for exactly the same reasons. Why would you even consider a different db?

  4. seizethedave
    Member
    Posted 8 years ago #

    I just didn't know if using the wordpress database for your own tables was something commonly done.
    Initially I didn't know about the wpdb class and it seemed like tossing stuff in the WordPress database would be kinda like messing with underlying implementation details.

    so yes, thanks. i'll toss the stuff in the wp db.

Topic Closed

This topic has been closed to new replies.

About this Topic