Jump to content

[SOLVED] Action Script not Executing some Code?


Recommended Posts

My action script that adds points to the users, and updates the database is not doing any of the mysql querys, it has work times and times before, but not now for some reason. It does redirect, but it does not echo anything out. I have no idea why.


Here is the code:

$path = "../../";
$title = "Update Winners"; 
$u_login = "yes";
$admin = "yes"; 
include ($path."main/include/cons/head.php");
if(siteStat() == "Basketball" && $basketReg == 0){
function getPnts($round){
	$f = mysql_fetch_array(mysql_query("SELECT * FROM `basket_pnts` WHERE `round` = '".$round."'"));
	return $f['value'];
$i = 1;
$cnt = 1;
	if($i <= 16*1){
		$r = "a";
	}else if($i <= 16*2){
		$r = "b";
	}else if($i <= 16*3){
		$r = "c";
	}else if($i <=16 *4){
	 	$r = "d";
	$win = $_POST[$cnt."_".$r];
	$spot = $cnt;
	$round = $_POST['round'];
		mysql_query("INSERT INTO `basket_winner` (team, region, spot, round) VALUES ('".$win."', '".$r."', '".$spot."', '".$round."')")or die(mysql_error());
		$pnt = getPnts($round);
		$table = "basket_rnd".$round;			
		$q = mysql_query("SELECT * FROM `".$table."` WHERE `".$spot."` = '".$win."' AND `region` = '".$r."'");
		while($f = mysql_fetch_array($q)){
			$usr = $f['user'];
			$p = mysql_query("SELECT * FROM `basket_usrpnts` WHERE `user` = '".$usr."'");
			$p = mysql_fetch_array($p);
			$brnd = "rnd".$round;
			$rnd = $p[$brnd];
			$total = $p['total'];
			mysql_query("UPDATE `basket_usrpnts` SET `".$brnd."` = '".$rnd."', `total` = '".$total."' WHERE `user` = '".$usr."'");
			echo $table." ".$spot." ".$usr." ".$pnt;
	if($cnt <= 16){
		$cnt = 1;
//header("Location: up_win.php");		
header("Location: ../index.php");
include ($path."main/include/cons/foot.php");

Link to comment
Share on other sites

Well, if it is redirecting it means:

if(siteStat() == "Basketball" && $basketReg == 0)

is failing



A few things I would do. Check to see if those variables are coming out to what they should - if not (which they aren't) find the source. Also, add in error_reporting(E_ALL); to the top of the script to see if something is causing a warning/error.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.