Forum Moderators: coopster
Here it is aswell.
<?
include("funcs.php");
$time1=time();$getgames = mysql_query("SELECT round FROM $tab[game] WHERE ends>'$time1';");
while ($game = mysql_fetch_array($getgames))
{
$get#*$!s = mysql_query("SELECT code,id,status,subscribe1a,subscribe2b FROM $tab[#*$!] WHERE id>'0';");
while ($#*$!s = mysql_fetch_array($getpimps))
{
$chkcode=$pimps[0];
$pimpusrinfos = mysql_query("SELECT code,id,status,statusexpire,subscribe1a,subscribe2b,sub1aexpires,sub2bexpires FROM $tab[user] WHERE code='$chkcode';");
while ($pimpusrinfo = mysql_fetch_array($pimpusrinfos))
{
$check=admin;
$chsups=supporter;
$chsilv=yes;
$chgold=yes;
$chmaxadd=yes;
if (($pimpusrinfo[2]!= $check) && ($pimpusrinfo[3] < $time1) && ($pimpusrinfo[2]=$chsups)){
$thealert1 ="Your Supporter Status Package has ended!";
mysql_query("UPDATE r$game[0]_$tab[pimp] SET status='normal', newalert='1', alert='$thealert1' WHERE id>0;");
}
if (($pimpusrinfo[2]!= $check) && ($pimpusrinfo[3] > $time1) && ($pimpusrinfo[2]=$chsups)){
mysql_query("UPDATE r$game[0]_$tab[pimp] SET status='supporter' WHERE id>'0';");
}
if (($pimpusrinfo[2]!= $check) && ($pimpusrinfo[6] < $time1) && ($pimpusrinfo[4]=$chsilv)){
$thealert2 ="Your Silver Subscription Package has ended!";
mysql_query("UPDATE r$game[0]_$tab[pimp] SET subscribe1a='no', newalert='1', alert='$thealert2' WHERE id>0;");
}
if (($pimpusrinfo[2]!= $check) && ($pimpusrinfo[6] > $time1) && ($pimpusrinfo[4]=$chsilv)){
mysql_query("UPDATE r$game[0]_$tab[pimp] SET subscribe1a='yes' WHERE id>0;");
}
if (($pimpusrinfo[2]!= $check) && ($pimpusrinfo[7] < $time1) && ($pimpusrinfo[5]=$chgold)){
$thealert3 ="Your Gold Subscription Package has ended!";
mysql_query("UPDATE r$game[0]_$tab[pimp] SET subscribe2b='no', newalert='1', alert='$thealert3' WHERE id>0;");
}
if (($pimpusrinfo[2]!=$check) && ($pimpusrinfo[7]>$time1) && ($pimpusrinfo[5]==$chgold)){
mysql_query("UPDATE r$game[0]_$tab[pimp] SET subscribe2b='yes' WHERE id>0;");
}
echo "completed GAME $game[0] PIMP $pimps[1] USER $pimpusrinfo[1]<br>";
}
}
}
?>
Any help would be great.
Its to pull from each game the Pimp in that game then there master account information and update there in game status accordingly..
This file will be hit by a cron and update that way.
[edited by: jatar_k at 5:31 am (utc) on Jan. 30, 2006]
[edit reason] no urls thanks [/edit]
Any help would be great.Its to pull from each game the Pimp in that game then there master account information and update there in game status accordingly..
I thought i had done so.
It pulls there infortion from teh different tablkes and matches them to each other quite fine.
but the update query is not updating as it should.
Its to pull from each game the Pimp in that game then there master account information and update there in game status accordingly..
the update query is not updating as it should.
Have you tried to echo each query to see how the query looks like? If not, it is the way to go to debug SQL queries!
Note that
echo "mysql_query("UPDATE r$game[0]_$tab[#*$!] SET subscribe2b='yes' WHERE id>0;")";will not echo your query. You should have something like
$sql="UPDATE r$game[0]_$tab[pimp] SET subscribe2b='yes' WHERE id>0";to echo your query.
echo $sql;
mysql_query($sql);
Last remark, MYSQL will not update if you are trying to update a value with the same value.