Support » Plugins » Problems quering different db

  • Hi all, i’m trying to integrate the phpbb3 login system with the comment form in wordpress so that authenticated people is automatically recognized and doesn’t need to input name and email or login to comment.

    To do so i read a phpbb3 cookie and then query the database to get the data i need. Here is the code i use (file comments.php):

    <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
    //inizio modifica per personalizzazione viterbolive
    $userSID = $_COOKIE["phpbb3_osrzf_sid"];
    //apro connessione...
    $myCon = mysql_connect("localhost","root","");
    if (!$myCon) {
    	die('Connessione fallita: ' . mysql_errore());
    	$sqlSelect = "SELECT username, user_email, user_avatar, user_id " .
    	"FROM <code>phpbb_users</code> " .
    	"INNER JOIN <code>phpbb_sessions</code> ON session_user_id = user_id " .
    	"WHERE session_id = '" . $userSID . "'";
    	mysql_select_db("forum", $myCon);
    	$result = mysql_query($sqlSelect);
    	while($row = mysql_fetch_array($result))
    		$myUserName = $row['username'];
    		$myEmail = $row['user_email'];
    //fine modifica
    <?php if ($myUserName!='Anonymous' and $myUserName!='') : ?>

    With this code i obtain the result expected but i mess up all the other queries in the page. All the queries executed after this code return the following error on screen:

    Warning: mysql_error(): 8 is not a valid MySQL-Link resource in D:\xampp\htdocs\wordpress\wp-includes\wp-db.php on line 236
    No categories

    Any suggestion? What am i doing wrong and how can i solve it? Thank you all!

Viewing 5 replies - 1 through 5 (of 5 total)
  • I am encoutering the same thing as your problem… Even more f***ed up, comment the mysql_close, and now you’ll see the sidebars totally disappear… I’m still looking for a fix!

    Anyone ?




    1, Learn some patience. A bump after an hour doesnt make you any friends. AND I dont know where you are but its 6am CST in the states and some people do sleep.

    2. Search. This isnt a brand new topic.

    I have searched… nothing found. I have the same error as simoart with

    Warning: mysql_error(): 8 is not a valid MySQL-Link resource

    with the file wp-db.php

    It has suddenly stopped making errors. Don’t ask me why lol ! Topic resolved…

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Problems quering different db’ is closed to new replies.