• I have a main site and WordPress installed as a subdirectory from this main site.

    I am trying to use the WordPress loop in a page on my main site, which already has a database connection open to a different database (Not the WordPress DB). I am getting errors stating that the headers have already been sent when I try to include the WP_BLOG_HEADER file.

    Can anyone tell me how I would get information from WordPress (in this case, the 5 most popular votes), if I am already connected to a different database and need to reconnect to that other database after displaying the 5 most popular votes from WordPress?

    Thank you very much.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    Include the blog header file as the very first thing in your other site. You can’t include it after your site has already generated some kind of output.

    you also need to use the new_link parameter so that mysql knows this is another connection. The php page is down for this so just google mysql new_link for more info

    Thread Starter rio38

    (@rio38)

    I tried both of those and still can’t get it to work. Very frustrated with this one. I need to make a call from my main DB then a call from the WordPress DB then go back to my other DB because I have a bunch of include files that make up subpages.

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

The topic ‘Call to wp_blog_header while connected to another database’ is closed to new replies.