Jump to content
MakeWebGames

Recommended Posts

Posted

Hello I have implemented the racing feature into my website yet when I send a challenge to a user, If they try to accept or decline it, They get this error:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND (ch.chCHR=298 OR ch.chCHD=298)' at line 1

This error is produced through my accept page 446.php and decline 447.php when i click either option in 436.php. Below are the codes in all 3 files, If someone can help me fix these errors I would be grateful.

==============

436.php

==============

<?php

session_start();

require "6.php";

if($_SESSION['loggedin']==0) { header("Location: 14.php");exit; }

$userid=$_SESSION['userid'];

require "5.php";

$h = new headers;

include "7.php";

global $c;

$is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error());

$ir=mysql_fetch_array($is);

check_level();

$h->startheaders();

$fm=money_formatter($ir['water']);

$cm=money_formatter($ir['crystals'],'');

$lv=date('F j, Y, g:i a',$ir['laston']);

$h->userdata($ir,$lv,$fm,$cm);

$h->menuarea();

mysql_query("UPDATE users SET bPAGE = 'Viewing Challenge' WHERE userid = $userid");

$id=abs((int) $_GET['id']);

$q=mysql_query("SELECT ch.*, cp.*, ct.*, u1.username as challenger, u2.username as challenged FROM challenges ch LEFT JOIN cars_playercars cp ON ch.chCHRCAR=cp.cpcID LEFT JOIN cars_types ct ON ct.carID=cp.cpcCAR LEFT JOIN users u1 ON ch.chCHR=u1.userid LEFT JOIN users u2 ON ch.chCHD=u2.userid WHERE ch.chID={$id} AND (ch.chCHR=$userid OR ch.chCHD=$userid)", $c) or die(mysql_error());

if(mysql_num_rows($q) == 0) {

echo"<center><table width=90%><tr><td><b><font color=red><b>Error | You Are Trying To View An Invalid Race Challenge, Or A Challenge That Does Not Exist.</b></font><META HTTP-EQUIV=Refresh CONTENT='3;url=238.php'></td></tr></table></center><br />$uu<br />";

exit($h->endpage()); }

$r=mysql_fetch_array($q);

$uu="<center><img src='/1/3/topnav.gif' width=90% height=3></center>";

echo"<table width='100%'><tr><td valign='left' width='90%'><h3>| Users | My Port | View Challenge - From {$r['challenger']} To {$r['challenged']}</h3></td><td valign='left' width='10%'><a href='23.php#436'><img src='/1/3/help.gif' title='View Challenge Help'></a></td></tr></table>

$uu<center><table width=90%><tr><td valign=bottom width=20%><b><center><img src='/1/2/179.png' width=90 height=90><br />• <a href='21.php?u=179'>Kross</a> •</center></b></td><td valign=left><b><font color=blue>";

$chance = rand(1,2); {

if ($chance == 1) { echo"Here You Can View, Accept, Or Decline A Race Challenge That You Have Received From Another User."; }

if ($chance == 2) { echo"Cheating The A.I Engine Can Lead To The Termination Of Your Account, And Possible Legal Ramifications From Our Lawyers. Report All Cheaters/Exploiters To Keep A Clean And Safe Community For Everyone."; } }

echo "</font></b><br /></td></tr></table></center>$uu<br />";

include "3312.php";

if($ir['ttime'] > 0) { echo"<center><table width=90%><tr><td><b><font color=red><b>Error | You Are Currently Traveling And Have {$ir['ttime']} Minutes Left. Sit Back And Enjoy The Ride.</b></font><META HTTP-EQUIV=Refresh CONTENT='5;url=110.php'></td></tr></table></center><br />$uu<br />";

exit($h->endpage()); }

if($ir['jail'] > 0) { echo"<center><table width=90%><tr><td><b><font color=red><b>Error | You Cannot Access This Feature While You Are In The Grinder. You Will Be Released In {$ir['jail']} Minute(s).</b></font><META HTTP-EQUIV=Refresh CONTENT='5;url=59.php'></td></tr></table></center><br />$uu<br />";

exit($h->endpage()); }

if($ir['hospital'] > 0) { echo"<center><table width=90%><tr><td><b><font color=red><b>Error | You Cannot Access This Feature While You Are In The Clinic. You Will Be Released In {$ir['hospital']} Minute(s).</b></font><META HTTP-EQUIV=Refresh CONTENT='5;url=58.php'></td></tr></table></center><br />$uu<br />";

exit($h->endpage()); }

echo"<center><table width=90%><tr><td valign=left>

<b>Type: <font color=red>{$r['chTYPE']}</font></b><br />";

if($r['chTYPE'] == "Betted") { $bet='$'.number_format($r['chBET']); print "<b>Bet: $bet</b><br />"; }

echo"<b>Challengers Carrier: {$r['carNAME']}</b><br />

<b>Status: {$r['chSTATUS']}</b><br />";

if(($userid == $r['chCHD'] or $userid == 1) and $r['chSTATUS'] == "open")

{

$q=mysql_query("SELECT cp.*, ct.* FROM cars_playercars cp LEFT JOIN cars_types ct ON cp.cpcCAR=ct.carID WHERE cp.cpcPLAYER=$userid", $c);

$cars=array();

while($r=mysql_fetch_array($q))

{

$cars[$r['cpcID']]="{$r['carNAME']} - {$r['cpcACCLV']}/{$r['cpcHANLV']}/{$r['cpcSPDLV']}/{$r['cpcSHDLV']}";

}

echo"<br /><center><img src='/1/3/topnav.gif' width=100% height=3></center><br />

<h3>Manage This Challenge</h3>

<b>Accept It:</b><br />

<form action='446.php' method='post'>

Carrier To Use: <select name=car type=dropdown>";

foreach($cars as $k => $v)

{

echo"<option value='$k'>$v</option>";

}

echo"</select><br />

<input type='hidden' name='id' value='$id'>

<input type='submit' value='Accept Challenge' /></form>

<b>Decline Challenge:<br />

• <a href='447.php?id={$id}'>Click Here</a></b>";

}

echo"</td></tr></table></center><br />$uu<center><b>• <a href='238.php'>Go To My Users Port</a> •</b><br />$uu<br />";

$h->endpage();

?>

=================

446.php

=================

<?php

session_start();

require "6.php";

if($_SESSION['loggedin']==0) { header("Location: 14.php");exit; }

$userid=$_SESSION['userid'];

require "5.php";

$h = new headers;

include "7.php";

global $c;

$is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error());

$ir=mysql_fetch_array($is);

check_level();

$h->startheaders();

$fm=money_formatter($ir['water']);

$cm=money_formatter($ir['crystals'],'');

$lv=date('F j, Y, g:i a',$ir['laston']);

$h->userdata($ir,$lv,$fm,$cm);

$h->menuarea();

mysql_query("UPDATE users SET bPAGE = 'Accepting Challenge' WHERE userid = $userid");

$uu="<center><img src='/1/3/topnav.gif' width=90% height=3></center>";

echo"<table width='100%'><tr><td valign='left' width='90%'><h3>| Users | My Port | Accepting Race Challenge</h3></td><td valign='left' width='10%'><a href='23.php#446'><img src='/1/3/help.gif' title='Accepting Race Challenge Help'></a></td></tr></table>

$uu<center><table width=90%><tr><td valign=bottom width=20%><b><center><img src='/1/2/179.png' width=90 height=90><br />• <a href='21.php?u=179'>Kross</a> •</center></b></td><td valign=left><b><font color=blue>";

$chance = rand(1,3); {

if ($chance == 1) { echo"Accepting A Challenge Is The Easy Part, But The True Test Is Winning The Challenge."; }

if ($chance == 2) { echo"Cheating The A.I Engine Can Lead To The Termination Of Your Account, And Possible Legal Ramifications From Our Lawyers. Report All Cheaters/Exploiters To Keep A Clean And Safe Community For Everyone."; }

if ($chance == 3) { echo"Be Careful When Betting For Water To Not Leave Yourself In The Red."; }}

echo "</font></b><br /></td></tr></table></center>$uu<br />";

include "3312.php";

if($ir['ttime'] > 0) { echo"<center><table width=90%><tr><td><b><font color=red><b>Error | You Are Currently Traveling And Have {$ir['ttime']} Minutes Left. Sit Back And Enjoy The Ride.</b></font><META HTTP-EQUIV=Refresh CONTENT='5;url=110.php'></td></tr></table></center><br />$uu<br />";

exit($h->endpage()); }

if($ir['jail'] > 0) { echo"<center><table width=90%><tr><td><b><font color=red><b>Error | You Cannot Access This Feature While You Are In The Grinder. You Will Be Released In {$ir['jail']} Minute(s).</b></font><META HTTP-EQUIV=Refresh CONTENT='5;url=59.php'></td></tr></table></center><br />$uu<br />";

exit($h->endpage()); }

if($ir['hospital'] > 0) { echo"<center><table width=90%><tr><td><b><font color=red><b>Error | You Cannot Access This Feature While You Are In The Clinic. You Will Be Released In {$ir['hospital']} Minute(s).</b></font><META HTTP-EQUIV=Refresh CONTENT='5;url=58.php'></td></tr></table></center><br />$uu<br />";

exit($h->endpage()); }

$q=mysql_query("SELECT ch.*, cp.*, ct.*, u1.username as challenger, u2.username as challenged FROM challenges ch LEFT JOIN cars_playercars cp ON ch.chCHRCAR=cp.cpcID LEFT JOIN cars_types ct ON ct.carID=cp.cpcCAR LEFT JOIN users u1 ON ch.chCHR=u1.userid LEFT JOIN users u2 ON ch.chCHD=u2.userid WHERE ch.chID={$id} AND (ch.chCHR=$userid OR ch.chCHD=$userid)", $c) or die(mysql_error());

if(mysql_num_rows($q) == 0) {

echo"<center><table width=90%><tr><td><b><font color=red><b>Error | You Are Trying To Accept An Invalid Challenge, Or The Race You Are Trying To Accept Does Not Exist.</b></font><META HTTP-EQUIV=Refresh CONTENT='3;url=238.php'></td></tr></table></center><br />$uu<br />";

exit($h->endpage()); }

$r=mysql_fetch_array($q);

$id=abs((int) $_POST['id']);

$car=abs((int) $_POST['car']);

if(!$id || !$car) {

echo"<center><table width=90%><tr><td><b><font color=red><b>Error | You Are Trying To Accept An Invalid Challenge, Or The Race You Are Trying To Accept Does Not Exist.</b></font><META HTTP-EQUIV=Refresh CONTENT='3;url=238.php'></td></tr></table></center><br />$uu<br />";

exit($h->endpage()); }

$q=mysql_query("SELECT ch.*, cp.*, ct.*, u1.username as challenger, u2.username as challenged FROM challenges ch LEFT JOIN cars_playercars cp ON ch.chCHRCAR=cp.cpcID LEFT JOIN cars_types ct ON ct.carID=cp.cpcCAR LEFT JOIN users u1 ON ch.chCHR=u1.userid LEFT JOIN users u2 ON ch.chCHD=u2.userid WHERE ch.chID={$id} AND (ch.chCHR=$userid OR ch.chCHD=$userid)", $c) or die(mysql_error());

if(mysql_num_rows($q) == 0) {

echo"<center><table width=90%><tr><td><b><font color=red><b>Error | You Are Trying To Accept An Invalid Challenge, Or The Race You Are Trying To Accept Does Not Exist.</b></font><META HTTP-EQUIV=Refresh CONTENT='3;url=238.php'></td></tr></table></center><br />$uu<br />";

exit($h->endpage()); }

$r=mysql_fetch_array($q);

if($r['chSTATUS']=="open") {

$bet=$r['chBET'];

if($bet > $ir['water']) {

echo"<center><table width=90%><tr><td><b><font color=red><b>Error | You Are Trying To Accept A Challenge With A wager That You Cannot Afford, Try To Accept It Again When You Have More Water On You Then The Amount Of The Challenges Wager.</b></font><META HTTP-EQUIV=Refresh CONTENT='5;url=238.php'></td></tr></table></center><br />$uu<br />";

exit($h->endpage()); }

$q=mysql_query("SELECT cp.*,ct.* FROM cars_playercars cp LEFT JOIN cars_types ct ON ct.carID=cp.cpcCAR WHERE cp.cpcID={$car} AND cp.cpcPLAYER=$userid", $c);

if(mysql_num_rows($q) == 0) {

echo"<center><table width=90%><tr><td><b><font color=red><b>Error | You Are Trying To Accept A Challenge With A Invalid Carrier, Or A Carrier That Does Not Exist.</b></font><META HTTP-EQUIV=Refresh CONTENT='3;url=238.php'></td></tr></table></center><br />$uu<br />";

exit($h->endpage()); }

$m=mysql_fetch_array($q);

if($m['cpcID'] == $r['cpcID']) {

echo"<center><table width=90%><tr><td><b><font color=red><b>Error | You Are Trying To Accept A Invalid Challenge, Or You Are Trying To Do An Invalid Function Which Is Against The System.</b></font><META HTTP-EQUIV=Refresh CONTENT='3;url=238.php'></td></tr></table></center><br />$uu<br />";

exit($h->endpage()); }

echo"<center><table width=90%><tr><td><b><font color=blue><b>Ciao | You Have Successfully Accepted This Challenge, You Will Receive The Results Of This Race In An Event.</b></font><META HTTP-EQUIV=Refresh CONTENT='5;url=238.php'></td></tr></table></center><br />$uu<br />";

mysql_query("UPDATE users SET water=water-$bet WHERE userid={$userid}", $c);

$q=mysql_query("SELECT * FROM cars_tracks ORDER BY rand() LIMIT 1", $c);

$t=mysql_fetch_array($q);

$stats_y=0;

$stats_y+=$m['cpcACCLV']*$m['carACC']*$t['ctrkACC'];

$stats_y+=$m['cpcHANLV']*$m['carHAN']*$t['ctrkHAN'];

$stats_y+=$m['cpcSPDLV']*$m['carSPD']*$t['ctrkSPD'];

$stats_y+=$m['cpcSHDLV']*$m['carSHD']*$t['ctrkSHD'];

$stats_o=0;

$stats_o+=$r['cpcACCLV']*$r['carACC']*$t['ctrkACC'];

$stats_o+=$r['cpcHANLV']*$r['carHAN']*$t['ctrkHAN'];

$stats_o+=$r['cpcSPDLV']*$r['carSPD']*$t['ctrkSPD'];

$stats_o+=$r['cpcSHDLV']*$r['carSHD']*$t['ctrkSHD'];

$stats_y*=rand(800,1200);

$stats_o*=rand(800,1200);

$notes="No One Won Anything";

mysql_query("UPDATE users SET cars_challs_accpt=cars_challs_accpt+1 WHERE userid=$userid", $c);

if($stats_y > $stats_o)

{

$winner=$ir['username'];

$winnings=$bet*2;

mysql_query("UPDATE users SET water=water+$winnings, cars_races_income=cars_races_income+$bet,cars_races_won=cars_races_won+1 WHERE userid={$r['chCHD']}", $c);

mysql_query("UPDATE users SET cars_races_income=cars_races_income-$bet,cars_races_lost=cars_races_lost+1 WHERE userid={$r['chCHR']}", $c);

if($bet > 0)

{

$notes="{$r['challenged']} won \$$winnings";

}

if($r['chTYPE'] == "High-Stakes")

{

mysql_query("UPDATE cars_playercars SET cpcPLAYER=$userid WHERE cpcID={$r['cpcID']}", $c);

$notes="{$r['challenged']} Won {$r['challenger']}\'s {$r['carNAME']}";

mysql_query("UPDATE users SET cars_lost=cars_lost+1 WHERE userid={$r['chCHR']}", $c);

mysql_query("UPDATE users SET cars_won=cars_won+1,cars_owned=cars_owned+1 WHERE userid={$r['chCHD']}", $c);

mysql_query("UPDATE cars_playercars SET cpcDAMAGE=cpcDAMAGE+1 WHERE cpcPLAYER={$m['cpcID']}", $c);

mysql_query("UPDATE cars_playercars SET cpcDAMAGE=cpcDAMAGE+2 WHERE cpcPLAYER={$r['chCHR']}", $c);

mysql_query("DELETE FROM cars_playercars WHERE cpcDAMAGE=>99", $c);

}

else if($r['chTYPE'] == "Betted")

{

mysql_query("UPDATE users SET cars_races_betted=cars_races_betted+1 WHERE userid IN ({$r['chCHR']}, {$r['chCHD']})", $c);

mysql_query("UPDATE cars_playercars SET cpcDAMAGE=cpcDAMAGE+1 WHERE cpcPLAYER={$m['cpcID']}", $c);

mysql_query("UPDATE cars_playercars SET cpcDAMAGE=cpcDAMAGE+1 WHERE cpcPLAYER={$r['chCHR']}", $c);

mysql_query("DELETE FROM cars_playercars WHERE cpcDAMAGE=>99", $c);

}

else

{

mysql_query("UPDATE users SET cars_races_friendly=cars_races_friendly+1 WHERE userid IN ({$r['chCHR']}, {$r['chCHD']})", $c);

mysql_query("UPDATE cars_playercars SET cpcDAMAGE=cpcDAMAGE+1 WHERE cpcPLAYER={$m['cpcID']}", $c);

mysql_query("UPDATE cars_playercars SET cpcDAMAGE=cpcDAMAGE+1 WHERE cpcPLAYER={$r['chCHR']}", $c);

mysql_query("DELETE FROM cars_playercars WHERE cpcDAMAGE=>99", $c);

}

}

else

{

$winner=$r['challenger'];

$winnings=$bet*2;

if($bet > 0)

{

$notes="{$r['challenger']} Won \$$winnings";

}

mysql_query("UPDATE users SET water=water+$winnings, cars_races_income=cars_races_income+$bet,cars_races_won=cars_races_won+1 WHERE userid={$r['chCHR']}", $c);

mysql_query("UPDATE users SET cars_races_income=cars_races_income-$bet,cars_races_lost=cars_races_lost+1 WHERE userid={$r['chCHD']}", $c);

if($r['chTYPE'] == "High-Stakes")

{

mysql_query("UPDATE cars_playercars SET cpcPLAYER={$r['chCHR']} WHERE cpcID={$m['cpcID']}", $c);

$notes="{$r['challenger']} Won {$r['challenged']}\'s {$m['carNAME']}";

mysql_query("UPDATE cars_playercars SET cpcDAMAGE=cpcDAMAGE+1 WHERE cpcPLAYER={$m['cpcID']}", $c);

mysql_query("UPDATE cars_playercars SET cpcDAMAGE=cpcDAMAGE+2 WHERE cpcPLAYER={$r['chCHR']}", $c);

mysql_query("DELETE FROM cars_playercars WHERE cpcDAMAGE=>99", $c);

mysql_query("UPDATE users SET cars_lost=cars_lost+1 WHERE userid={$r['chCHD']}", $c);

mysql_query("UPDATE users SET cars_won=cars_won+1,cars_owned=cars_owned+1 WHERE userid={$r['chCHR']}", $c);

}

else if($r['chTYPE'] == "Betted")

{

mysql_query("UPDATE users SET cars_races_betted=cars_races_betted+1 WHERE userid IN ({$r['chCHR']}, {$r['chCHD']})", $c);

mysql_query("UPDATE cars_playercars SET cpcDAMAGE=cpcDAMAGE+1 WHERE cpcPLAYER={$m['cpcID']}", $c);

mysql_query("UPDATE cars_playercars SET cpcDAMAGE=cpcDAMAGE+2 WHERE cpcPLAYER={$r['chCHR']}", $c);

mysql_query("DELETE FROM cars_playercars WHERE cpcDAMAGE=>99", $c);

}

else

{

mysql_query("UPDATE users SET cars_races_friendly=cars_races_friendly+1 WHERE userid IN ({$r['chCHR']}, {$r['chCHD']})", $c);

mysql_query("UPDATE cars_playercars SET cpcDAMAGE=cpcDAMAGE+1 WHERE cpcPLAYER={$m['cpcID']}", $c);

mysql_query("UPDATE cars_playercars SET cpcDAMAGE=cpcDAMAGE+1 WHERE cpcPLAYER={$r['chCHR']}", $c);

mysql_query("DELETE FROM cars_playercars WHERE cpcDAMAGE=>99", $c);

}

}

$challengercar=$r['carNAME'];

$challengedcar=$m['carNAME'];

mysql_query("INSERT INTO race_results VALUES('', '{$r['chTYPE']}', '{$r['chBET']}', '{$r['challenger']}', '{$r['challenged']}', '$challengercar', '$challengedcar','$winner', '$notes')", $c);

$i=mysql_insert_id($c);

event_add($r['chCHR'], "Your Race With {$r['challenged']} Is Finished. Click <a href='440.php?race={$i}'><font color='blue'><b>Here</b></font></a> To View The Results.</a>", $c);

event_add($r['chCHD'], "Your Race With {$r['challenger']} Is Finished. Click <a href='440.php?race={$i}'><font color='blue'><b>Here</b></font></a> To View The Results.</a>", $c);

mysql_query("UPDATE challenges SET chSTATUS='accepted' WHERE chID={$id}", $c);

}

exit($h->endpage());

?>

Posted

===========

447.php

================

<?php

session_start();

require "6.php";

if($_SESSION['loggedin']==0) { header("Location: 14.php");exit; }

$userid=$_SESSION['userid'];

require "5.php";

$h = new headers;

include "7.php";

global $c;

$is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error());

$ir=mysql_fetch_array($is);

check_level();

$h->startheaders();

$fm=money_formatter($ir['water']);

$cm=money_formatter($ir['crystals'],'');

$lv=date('F j, Y, g:i a',$ir['laston']);

$h->userdata($ir,$lv,$fm,$cm);

$h->menuarea();

$q=mysql_query("SELECT ch.*, cp.*, ct.*, u1.username as challenger, u2.username as challenged FROM challenges ch LEFT JOIN cars_playercars cp ON ch.chCHRCAR=cp.cpcID LEFT JOIN cars_types ct ON ct.carID=cp.cpcCAR LEFT JOIN users u1 ON ch.chCHR=u1.userid LEFT JOIN users u2 ON ch.chCHD=u2.userid WHERE ch.chID={$id} AND (ch.chCHR=$userid OR ch.chCHD=$userid)", $c) or die(mysql_error());

if(mysql_num_rows($q) == 0) {

echo"<center><table width=90%><tr><td><b><font color=red><b>Error | You Are Trying To Decline An Invalid Challenge, Or A Challenge That Does Not Exist.</b></font><META HTTP-EQUIV=Refresh CONTENT='3;url=238.php'></td></tr></table></center><br />$uu<br />";

exit($h->endpage()); }

$r=mysql_fetch_array($q);

mysql_query("UPDATE users SET bPAGE = 'Declining Challenge' WHERE userid = $userid");

$uu="<center><img src='/1/3/topnav.gif' width=90% height=3></center>";

echo"<table width='100%'><tr><td valign='left' width='90%'><h3>| Users | My Port | Declining Race Challenge From {$r['challenger']} To {$r['challenged']}</h3></td><td valign='left' width='10%'><a href='23.php#447'><img src='/1/3/help.gif' title='Declining Race Challenge Help'></a></td></tr></table>

$uu<center><table width=90%><tr><td valign=bottom width=20%><b><center><img src='/1/2/179.png' width=90 height=90><br />• <a href='21.php?u=179'>Kross</a> •</center></b></td><td valign=left><b><font color=blue>";

$chance = rand(1,3); {

if ($chance == 1) { echo"Declining A Challenge Is The Easy Part, But The True Test Is Winning The Challenge."; }

if ($chance == 2) { echo"Cheating The A.I Engine Can Lead To The Termination Of Your Account, And Possible Legal Ramifications From Our Lawyers. Report All Cheaters/Exploiters To Keep A Clean And Safe Community For Everyone."; }

if ($chance == 3) { echo"Be Careful When Betting For Water To Not Leave Yourself In The Red."; }}

echo "</font></b><br /></td></tr></table></center>$uu<br />";

include "3312.php";

if($ir['ttime'] > 0) { echo"<center><table width=90%><tr><td><b><font color=red><b>Error | You Are Currently Traveling And Have {$ir['ttime']} Minutes Left. Sit Back And Enjoy The Ride.</b></font><META HTTP-EQUIV=Refresh CONTENT='5;url=110.php'></td></tr></table></center><br />$uu<br />";

exit($h->endpage()); }

if($ir['jail'] > 0) { echo"<center><table width=90%><tr><td><b><font color=red><b>Error | You Cannot Access This Feature While You Are In The Grinder. You Will Be Released In {$ir['jail']} Minute(s).</b></font><META HTTP-EQUIV=Refresh CONTENT='5;url=59.php'></td></tr></table></center><br />$uu<br />";

exit($h->endpage()); }

if($ir['hospital'] > 0) { echo"<center><table width=90%><tr><td><b><font color=red><b>Error | You Cannot Access This Feature While You Are In The Clinic. You Will Be Released In {$ir['hospital']} Minute(s).</b></font><META HTTP-EQUIV=Refresh CONTENT='5;url=58.php'></td></tr></table></center><br />$uu<br />";

exit($h->endpage()); }

$id=abs((int) $_GET['id']);

if(!$id) {

echo"<center><table width=90%><tr><td><b><font color=red><b>Error | You Are Trying To Decline An Invalid Challenge, Or A Challenge That Does Not Exist.</b></font><META HTTP-EQUIV=Refresh CONTENT='3;url=238.php'></td></tr></table></center><br />$uu<br />";

exit($h->endpage()); }

$q=mysql_query("SELECT ch.*, cp.*, ct.*, u1.username as challenger, u2.username as challenged FROM challenges ch LEFT JOIN cars_playercars cp ON ch.chCHRCAR=cp.cpcID LEFT JOIN cars_types ct ON ct.carID=cp.cpcCAR LEFT JOIN users u1 ON ch.chCHR=u1.userid LEFT JOIN users u2 ON ch.chCHD=u2.userid WHERE ch.chID={$id} AND (ch.chCHR=$userid OR ch.chCHD=$userid) AND ch.chSTATUS='open'", $c) or die(mysql_error());

if(mysql_num_rows($q) == 0) {

echo"<center><table width=90%><tr><td><b><font color=red><b>Error | You Are Trying To Decline An Invalid Challenge, Or A Challenge That Does Not Exist.</b></font><META HTTP-EQUIV=Refresh CONTENT='3;url=238.php'></td></tr></table></center><br />$uu<br />";

exit($h->endpage()); }

$r=mysql_fetch_array($q);

mysql_query("UPDATE users SET water=water+{$r['chBET']} WHERE userid={$r['chCHR']}", $c);

event_add($r['chCHR'],"{$ir['username']} Declined Your Racing Challenge.", $c);

mysql_query("UPDATE challenges SET chSTATUS='declined' WHERE chID={$id}", $c);

mysql_query("UPDATE users SET cars_challs_decln=cars_challs_decln+1 WHERE userid=$userid", $c);

echo"<center><table width=90%><tr><td><b><font color=blue><b>Ciao | You Have Successfully Declined The Race Challenge.</b></font><META HTTP-EQUIV=Refresh CONTENT='4;url=238.php'></td></tr></table></center><br />$uu<br />";

$h->endpage();

?>

Join the conversation

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

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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...