Not writting to database..Please help

jdoyle55's Avatar, Join Date: Apr 2010
Newbie 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 Code:
$link = mysql_connect($dbhost, $dbuser, $dbpassword)
or die("Could not connect: " . mysql_error());
  $sSQL="select n_ID, n_RefererID from t_Users where b_Activated<>1 and s_Username=\"".stripjunk($username)."\" and n_Rand=".stripjunk($rand);
  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");
   list($n_ID, $n_RefererID)=mysql_fetch_row($results);
 $sSQL="update t_Users set b_Activated=1 where n_ID=$n_ID";
 $sSQL="update t_Users set n_Credits=n_Credits+$referral_credits where n_ID=".stripjunk($n_RefererID);
   include ("header.php");
 echo "Congratulations, your account is now active, please click <a href=./login.php>here</a> to log in";
    include ("footer.php");

Last edited by shabbir; 14Apr2010 at 06:34.. Reason: Code blocks
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
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.