Not writting to database..Please help

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

  1. jdoyle55

    jdoyle55 New Member

    Joined:
    Apr 13, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    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

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    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

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice