WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] SQL Query (2 posts)

  1. dicegame
    Member
    Posted 6 years ago #

    Hi everyone!

    I'm looking to create a query which pulls data from a vbulletin table. I'm unsure how queries work on WordPress. My Vbulletin tables is on the same database as the WordPress tables.

    This is what i've got:

    <?php  if (is_user_logged_in()) {
    
    global $userdata;
    get_currentuserinfo();
    
    $user = $userdata->user_login;
    
    $userhub = $wpdb->get_col("SELECT userhub
    	FROM user
    	WHERE username = $user");
    
    $userhubimage = $row[userhub];
    
    echo "$userhubimage";
    
    }
    
         }  else {
    
               echo "Welcome, visitor!";
    }
    ?>
  2. dicegame
    Member
    Posted 6 years ago #

    Nevermind i figured it out.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.