Viewing 9 replies - 1 through 9 (of 9 total)
  • AFAIK, there’s no way to do this.

    https://www.ads-software.com/support/topic/96877?replies=5

    Sure use real live mysql queries instead of what I explained in the other thread. PHP and MySQL talk just fine, even if you dont have wordpress there.

    $connection = mysql_connect("whatever", "username", "password");
    mysql_select_db("database");
    blah blah blah;

    Thats my answer, someone else might have a another idea.

    OR…

    you could maybe use variables to identify which wordpress db youre trying to connect to.. assuming of course that youre not trying to pull data at the same time, that is.

    That said, you already identified that theyre in 2 seperate directories .. why not include 1 header when you need to connect to 1 and include the second header when you need to connect to the 2nd one?

    Just tossing out ideas.

    Would be helpful (maybe?) to find out a bit more about what, exactly the desired end result is?

    In other words, the “what” of it all.

    You may or may not have issues with mysql_close though, any way you end up doing it. I have never investigated whether or not WP actually closes its mysql connection. I’m assuming it does, eventually. ??

    And that would get in the way, if not.

    Thread Starter fender963

    (@fender963)

    I tried including each header when I need the data from each but the second require is just ignored.

    Basically I’m doing a simple show the newest 5 posts deal.

    For example this is my code:

    <?php require(‘blog1/wp-blog-header.php’); ?>
    <?php $counter = 0; //Initialize custom counter so loop will only run for set time.?>
    <?php query_posts(‘cat=0’); ?>

      <?php if (have_posts()) : while (have_posts() && $counter < 5) : the_post(); ?>
      <?php $counter++; ?>

    • ” rel=”bookmark”><?php the_title(); ?>
    • <?php endwhile; else: ?>
      <p><?php _e(‘Sorry, no posts matched your criteria.’); ?></p>
      <?php endif; ?>

    I just want to be able to do that on the same page, for both blogs.

    Thread Starter fender963

    (@fender963)

    Whooami,

    I am trying to pull data from each at the same time. I can’t do a simple mysql_connect etc… because I need the functionality of WordPress Permalinks.

    Basically I’m doing a simple show the newest 5 posts deal.

    How about a Syndication plugin instead?
    https://codex.www.ads-software.com/Plugins/Syndication

    Am I over-simplifying or is there a need to really take this to hand-coding?

    [Updated] I should add that if you’re using widgets there are RSS widgets as well that’ll do this.

    I tried including each header when I need the data from each but the second require is just ignored.

    Having looked through wp 2.0.5 using my trusty grep tool, I find not one instance of mysql_close.

    That might explain that problem, or not.

    handy’s solution looks promising.

    I will mess with this a little and see if I might debug it, I have 2 installs i can play with.

    *cough* implicit doesnt really work in your scenario *cough*

    https://comox.textdrive.com/pipermail/wp-trac/2006-June/001774.html

    Thread Starter fender963

    (@fender963)

    Any luck Whooami?

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Use functions from two different Blogs on same page.’ is closed to new replies.