• I have this problem I can’t resolve by myself please help.

    My sidebar displays the latest 10 posts extracted from phpbb3 forum. It works with this function

    function wpphpbb_topics() {
    //set forum path, forum host
    $forum_path = "forum-snowboard";
    $host = "https://www.snowboarditaliamag.it/forum-snowboard";
    include("".$forum_path."/config.php");
    $connection = mysql_connect($dbhost, $dbuser, $dbpasswd);
    $s_db = mysql_select_db($dbname, $connection);
    $phpbbq = "SELECT * FROM ".$table_prefix."topics ORDER BY topic_last_post_id DESC LIMIT 0,10";
    $results = mysql_query($phpbbq, $connection);
    while ($resultsow = mysql_fetch_array($results)) {
    $topic_tit = $resultsow[topic_title];
    // You can wrap long words below, where 60 is the lenght.
    $topics_title = substr($topic_tit, 0, 60);
    echo "<li><a href=\"$host"."/viewtopic.php?t=$resultsow[topic_id]\">$topics_title</a></li>";
    }
    }

    The problem is that this function closes the initial wordpress connection to the database and everything dynamic following the function is not working anymore because the new connectin to phpbb forum database has been made….

    Anyone knows how to resotre the original wp db connection after having extracted latest phpbb topics?!

    Please help, getting crazy…. already tried lots of solutions wihtous lucky…

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘MYSQL QUERY FROM ANOTHER DB CLOSES WP DB CONNECTION’ is closed to new replies.