1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Advanced mysql

Discussion in 'General PHP and MySQL Discussions' started by Mrdiamond123, Mar 14, 2014.

  1. Mrdiamond123

    Mrdiamond123 Member

    function LinkToForumAccount($strUsername, $strPassword)
    {
    $strPassword = sha1(strtolower($strUsername) . $strPassword);
    $retQuery = MySQLQuery(vsprintf("SELECT user_id FROM xf_user WHERE username = '%s' AND PASSWORD = '%s'", array(MySQLEscape($strUsername), MySQLEscape($strPassword))));
    $strSteamID = UserProfile()->SteamID();

    if(mysql_num_rows($retQuery) == 1)
    {
    $arrData = mysql_fetch_array($retQuery);
    $iID = $arrData['user_id'];

    MySQLQuery(vsprintf("UPDATE panelz_players SET forumid = '%s' WHERE steamid = '%s'", array($iID, $this->SteamID())));

    return true;
    }

    LinkLog('FORUM_LINK', "Linking SteamID $strSteamID failed with login '" . $strUsername . "' '" . $strPassword . "'.", 'FORUM_LINK_FAIL');

    return false;
    }

    As you see i have to select password from my database, is there a way i can do this?
     
    Last edited: Mar 14, 2014
  2. Mrdiamond123

    Mrdiamond123 Member

    No one can help :s?
     

Share This Page