Forums

Open mysql connection to second wp database (1 post)

  1. smallbizpod
    Member
    Posted 4 years ago #

    I have two separate WP installs in two separate databases. I'd like to call data from database 'A' to insert into the sidebar of WP in database 'B'. I have two questions:

    1. am I right in thinking this is possible? Presumably I can include some php/mysql code to open database 'A' in the sidebar of WP on database 'B' and then use $wpdb to query the relevant data (in this case excerpts of posts).

    2. if this is possible, are there any security issues I should be aware of? Normally database name and password would only appear in config.php. Are there any risks in having this data in a theme template file such as sidebar.php?

Topic Closed

This topic has been closed to new replies.

About this Topic

  • RSS feed for this topic
  • Started 4 years ago by smallbizpod
  • This topic is not a support question
  • WordPress version: 2.3