1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

Not writting to database..Please help

Discussion in 'PHP' started by jdoyle55, Apr 13, 2010.

  1. jdoyle55

    jdoyle55 New Member

    I purchased this script in PHP and it's not writting to the database. Irf someone could have a look and tell me why I sure would appreciate it the code is :
    PHP:
    <?
    include(
    "common.php");
    $link mysql_connect($dbhost$dbuser$dbpassword)
    or die(
    "Could not connect: " mysql_error());
      
    mysql_select_db($dbname);
      
    $sSQL="select n_ID, n_RefererID from t_Users where b_Activated<>1 and s_Username=\"".stripjunk($username)."\" and n_Rand=".stripjunk($rand);
      
    $results=mysql_query($sSQL);
      if(
    mysql_num_rows($results)==0)
      {
      include (
    "header.php");
       echo 
    "Sorry, either you followed a broken link, the account specified is already active, or it doesn't exist";
        include (
    "footer.php");
      }
      else
      {
       list(
    $n_ID$n_RefererID)=mysql_fetch_row($results);
     
    $sSQL="update t_Users set b_Activated=1 where n_ID=$n_ID";
     
    mysql_query($sSQL);
     
    $sSQL="update t_Users set n_Credits=n_Credits+$referral_credits where n_ID=".stripjunk($n_RefererID);
     
    mysql_query($sSQL);
       include (
    "header.php");
     echo 
    "Congratulations, your account is now active, please click <a href=./login.php>here</a> to log in";
        include (
    "footer.php");
      }
    mysql_close();
    ?>
     
    Last edited by a moderator: Apr 14, 2010
  2. shabbir

    shabbir Administrator Staff Member

    Ask the support from where you purchased the script because there may be many reasons and one of them could be that database does not exist and other could be permission of user.
     

Share This Page