Go4Expert

Go4Expert (http://www.go4expert.com/)
-   PHP (http://www.go4expert.com/forums/php/)
-   -   Not writting to database..Please help (http://www.go4expert.com/forums/writting-databaseplease-help-t21747/)

jdoyle55 14Apr2010 00:34

Not writting to database..Please help
 
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:

<?
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();
?>


shabbir 14Apr2010 06:35

Re: Not writting to database..Please help
 
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.


All times are GMT +5.5. The time now is 16:03.