Hello,

My site has a error:

Parse error: syntax error, unexpected T_STRING in /home/***/public_html/playground/maps.php on line 341

Line 341:

$getopp="SELECT * from a_pokemon where Pokemon='$getuser3[Opponent]'";
$getopp2=mysql_query($getopp) or die("Could not get Pokemon from database.");
$getopp3=mysql_fetch_array($getopp2);

Thanks,

Danyal.

The error may actually be on the line before it (or earlier) but not reported until that line. Check the lines above those for s missing semi-colon.

Here is the script:

The bold part is the error line.

<?php
if(!isset($_GET))
{
$Using= 'Starter';
}
else
{
$Using=$_GET;
}
if($Using != Starter && $Using != Second && $Using != Third && $Using != Fourth && $Using != Fifth && $Using != Sixth)
{$Using = Starter;}

if(!isset($_GET))
{
$Switched= '0';
}
else
{
$Switched=$_GET;
}

$get1pokemon="SELECT * from t_pokemon where ID='$getuser3[Starter]'";
$get1pokemon2=mysql_query($get1pokemon) or die("Could not get Pokemon from database.");
$get1pokemon3=mysql_fetch_array($get1pokemon2);

$getusingp="SELECT * from t_pokemon where ID='$getuser3[$Using]'";
$getusingp2=mysql_query($getusingp) or die("Could not get Pokemon from database.");
$getusingp3=mysql_fetch_array($getusingp2);

$getp="SELECT * from a_pokemon where Pokemon='$getusingp3[Pokemon]'";
$getp2=mysql_query($getp) or die("Could not get Pokemon from database.");
$getp3=mysql_fetch_array($getp2);

$getevolve="SELECT * from a_pokemon where Number='$getusingp3[Number]+1'";
$getevolve2=mysql_query($getevolve) or die("Could not get Pokemon from database.");
$getevolve3=mysql_fetch_array($getevolve2);

$getattack4="SELECT * from attacks where Attack='$getusingp3[Attack1]'";
$getattack5=mysql_query($getattack4) or die("Could not get Pokemon from database.");
$getattack6=mysql_fetch_array($getattack5);

$getattack7="SELECT * from attacks where Attack='$getusingp3[Attack2]'";
$getattack8=mysql_query($getattack7) or die("Could not get Pokemon from database.");
$getattack9=mysql_fetch_array($getattack8);

$getattack10="SELECT * from attacks where Attack='$getusingp3[Attack3]'";
$getattack11=mysql_query($getattack10) or die("Could not get Pokemon from database.");
$getattack12=mysql_fetch_array($getattack11);

$getattack13="SELECT * from attacks where Attack='$getusingp3[Attack4]'";
$getattack14=mysql_query($getattack13) or die("Could not get Pokemon from database.");
$getattack15=mysql_fetch_array($getattack14);

$UpdateMap="Update trainers set Map='$map', X='$x', Y='$y' where Username='$user'";
mysql_query($UpdateMap) or die("Could not set Map.");

@$hp = (($get1pokemon3[HP])/$get1pokemon3[MHP])*100;
@$hp2 = 100-$hp;

if($get2pokemon3)
{
$hp5 = (($get2pokemon3[HP])/$get2pokemon3[MHP])*100;
$hp6 = 100-$hp5;
}
if($get3pokemon3)
{
$hp7 = (($get3pokemon3[HP])/$get3pokemon3[MHP])*100;
$hp8 = 100-$hp7;
}
if($get4pokemon3)
{
$hp9 = (($get4pokemon3[HP])/$get4pokemon3[MHP])*100;
$hp10 = 100-$hp9;
}
if($get5pokemon3)
{
$hp11 = (($get5pokemon3[HP])/$get5pokemon3[MHP])*100;
$hp12 = 100-$hp11;
}
if($get6pokemon3)
{
$hp13 = (($get6pokemon3[HP])/$get6pokemon3[MHP])*100;
$hp14 = 100-$hp13;
}

?>
<center>
<script>

function submitonce(theform){
//if IE 4+ or NS 6+
if (document.all||document.getElementById){
//screen thru every element in the form, and hunt down "submit" and "reset"
for (i=0;i<theform.length;i++){
var tempobj=theform.elements
if(tempobj.type.toLowerCase()=="submit"||tempobj.type.toLowerCase()=="reset")
//disable em
tempobj.disabled=true
}
}
}
</script>

<script>

var linktext=new Array()
linktext[0]="Select An Attack<form method=\"POST\" onSubmit=\"submitonce(this)\"><table width='220' cellspacing='0' cellpadding='0' style='border-collapse:collapse'><tr><td style='border:1px solid black' valign='top' bgcolor='<?php print "$getattack6"; ?>' width='50%'><font face='verdana' size='1'><INPUT TYPE=RADIO NAME=Attack VALUE=\"<?php print "$getusingp3[Attack1]"; ?>\" CHECKED ><?php print "$getusingp3[Attack1]"; ?></INPUT></td><td style='border:1px solid black' valign='top' bgcolor='<?php print "$getattack9"; ?>'><font face='verdana' size='1'><INPUT TYPE=RADIO NAME=Attack VALUE=\"<?php print "$getusingp3[Attack2]"; ?>\"><?php print "$getusingp3[Attack2]"; ?></INPUT></td></tr><tr><td style='border:1px solid black' valign='top' bgcolor='<?php print "$getattack12"; ?>'><font face='verdana' size='1'><INPUT TYPE=RADIO NAME=Attack VALUE=\"<?php print "$getusingp3[Attack3]"; ?>\"><?php print "$getusingp3[Attack3]"; ?></INPUT></td><td style='border:1px solid black' valign='top' bgcolor='<?php print "$getattack15"; ?>'><font face='verdana' size='1'><INPUT TYPE=RADIO NAME=Attack VALUE=\"<?php print "$getusingp3[Attack4]"; ?>\"><?php print "$getusingp3[Attack4]"; ?></INPUT></td></tr></table><button type=\"submit\" name=\"attack\" value=\"attack\" class='button2'>Attack!</button></form>"

linktext[1]="Switch Pokemon<br><table width='220' cellspacing='1' cellpadding='0'><?php if($Using != Starter && $get1pokemon3[HP] > 0){print "<tr><td valign='top' width='50%' style='border:1px solid black' bgcolor='$get1pokemon3'><font face='verdana' size='1' color='$font'><b><a href='index.php?mode=maps&map=Route11&x=15&y=0&Using=Starter&Switched=1'>$get1pokemon3[Pokemon]</a><img src='images/$get1pokemon3[Gender].gif'></td><td valign='top'><font face='verdana' size='1'><b>HP:</b> $get1pokemon3[HP]<br><table width='100' style='border:1px solid black' cellspacing='0' cellpadding='0' height='7' bgcolor='white'><tr><td width='$hp' bgcolor='steelblue'></td><td width='$hp2'></tr></table></td></tr>";} ?><?php if($Using != Second && $get2pokemon3[HP] > 0){print "<tr><td valign='top' width='50%' style='border:1px solid black' bgcolor='$get2pokemon3'><font face='verdana' size='1' color='$font'><b><a href='index.php?mode=maps&map=Route11&x=15&y=0&Using=Second&Switched=1'>$get2pokemon3[Pokemon]</a><img src='images/$get2pokemon3[Gender].gif'></td><td valign='top'><font face='verdana' size='1'><b>HP:</b> $get2pokemon3[HP]<br><table width='100' style='border:1px solid black' cellspacing='0' cellpadding='0' height='7' bgcolor='white'><tr><td width='$hp5' bgcolor='steelblue'></td><td width='$hp6'></tr></table></td></tr>";} ?><?php if($Using != Third && $get3pokemon3[HP] > 0){print "<tr><td valign='top' width='50%' style='border:1px solid black' bgcolor='$get3pokemon3'><font face='verdana' size='1' color='$font'><b><a href='index.php?mode=maps&map=Route11&x=15&y=0&Using=Third&Switched=1'>$get3pokemon3[Pokemon]</a><img src='images/$get3pokemon3[Gender].gif'></td><td valign='top'><font face='verdana' size='1'><b>HP:</b> $get3pokemon3[HP]<br><table width='100' style='border:1px solid black' cellspacing='0' cellpadding='0' height='7' bgcolor='white'><tr><td width='$hp7' bgcolor='steelblue'></td><td width='$hp8'></tr></table></td></tr>";} ?><?php if($Using != Fourth && $get4pokemon3[HP] > 0){print "<tr><td valign='top' width='50%' style='border:1px solid black' bgcolor='$get4pokemon3'><font face='verdana' size='1' color='$font'><b><a href='index.php?mode=maps&map=Route11&x=15&y=0&Using=Fourth&Switched=1'>$get4pokemon3[Pokemon]</a><img src='images/$get4pokemon3[Gender].gif'></td><td valign='top'><font face='verdana' size='1'><b>HP:</b> $get4pokemon3[HP]<br><table width='100' style='border:1px solid black' cellspacing='0' cellpadding='0' height='7' bgcolor='white'><tr><td width='$hp9' bgcolor='steelblue'></td><td width='$hp10'></tr></table></td></tr>";} ?><?php if($Using != Fifth && $get5pokemon3[HP] > 0){print "<tr><td valign='top' width='50%' style='border:1px solid black' bgcolor='$get5pokemon3'><font face='verdana' size='1' color='$font'><b><a href='index.php?mode=maps&map=Route11&x=15&y=0&Using=Fifth&Switched=1'>$get5pokemon3[Pokemon]</a><img src='images/$get5pokemon3[Gender].gif'></td><td valign='top'><font face='verdana' size='1'><b>HP:</b> $get5pokemon3[HP]<br><table width='100' style='border:1px solid black' cellspacing='0' cellpadding='0' height='7' bgcolor='white'><tr><td width='$hp11' bgcolor='steelblue'></td><td width='$hp12'></tr></table></td></tr>";} ?><?php if($Using != Sixth && $get6pokemon3[HP] > 0){print "<tr><td valign='top' width='50%' style='border:1px solid black' bgcolor='$get6pokemon3'><font face='verdana' size='1' color='$font'><b><a href='index.php?mode=maps&map=Route11&x=15&y=0&Using=Sixth&Switched=1'>$get6pokemon3[Pokemon]</a><img src='images/$get6pokemon3[Gender].gif'></td><td valign='top'><font face='verdana' size='1'><b>HP:</b> $get6pokemon3[HP]<br><table width='100' style='border:1px solid black' cellspacing='0' cellpadding='0' height='7' bgcolor='white'><tr><td width='$hp13' bgcolor='steelblue'></td><td width='$hp14'></tr></table></td></tr>";} ?></table>"

linktext[2]="Use An Item<br><br><b>Coming Soon!</b>"

linktext[3]="Run From Battle<br><br><br><br><form method=\"POST\" onSubmit=\"submitonce(this)\"><button type=\"submit\" name=\"run\" value=\"run\" class='button2'>Escape!</button></form>"

var ns6=document.getElementById&&!document.all
var ie=document.all

function show_text(thetext, whichdiv){
if (ie) eval("document.all."+whichdiv).innerHTML=linktext[thetext]
else if (ns6) document.getElementById(whichdiv).innerHTML=linktext[thetext]
}

function resetit(whichdiv){
if (ie) eval("document.all."+whichdiv).innerHTML=''
else if (ns6) document.getElementById(whichdiv).innerHTML=''
}
</script>

<style type="text/css"><!--
.button2 {
background-color: lightgrey;
border-color: black;
border-style: solid;
border-width: 1px;
color: black;
font-size: 8pt;
font-family: verdana;
}

.select {
background-color: white;
border-color: black;
border-style: solid;
color: black;
font-size: 8pt;
font-family: verdana;
}

.table {
font: normal 9px;
font-family: verdana;
}


--></style>

<?php
if(isset($_SESSION))
{

if($map != Daycare && $map != BerryForest && $map != Route4 && $map != 'Route4-2' && $map != Route10 && $map != 'Route10-2' && $map != Route11 && $map != Route20 && $map != Route5 && $map != Route7)
{
if($x > 28)
{$x = 190+28;}
if($x < 0)
{$x = 190+0;}
if($y < 0)
{$y = 170+0;}
if($y > 25)
{$y = 170+25;}
}
if($map == Daycare || $map == BerryForest || $map == Route4 || $map == 'Route4-2' || $map == Route10 || $map == 'Route10-2' || $map == Route11 || $map == Route20 || $map == Route5 || $map == Route7)
{
if($x > 28)
{$x = 190+28;}
if($x < 0)
{$x = 190+0;}
if($y < 0)
{$y = 170+0;}
if($y > 37)
{$y = 170+37;}
}

$left = 190+($x*15);
$top = 170+($y*15);

$maptoget = $map;
$wildfound = RAND(1,5);
if($map == BerryForest)
{
$wildpoke = RAND(14,17);
}
if($map == Johto)
{
$wildpoke = RAND(4,6);
}
if($map == Route20)
{
$wildpoke = RAND(12,13);
}
if($map == Route10)
{
$wildpoke = RAND(18,19);
}
if($map == Route4)
{
$wildpoke = RAND(20,23);
}
if($map == 'Route10-2')
{
$wildpoke = RAND(24,26);
}
if($map == 'Route4-2')
{
$wildpoke = RAND(27,29);
}
if($map == 'Route13')
{
$wildpoke = RAND(30,32);
}
if($map == 'Route15')
{
$wildpoke = RAND(33,37);
}
if($map == 'Route11')
{
$wildpoke = RAND(38,41);
}
if($map == 'Route12')
{
$wildpoke = RAND(42,44);
}
if($map == 'Daycare')
{
$wildpoke = RAND(45,53);
}
if($map == 'Kanto')
{
$wildpoke = RAND(54,67);
}
if($map != Kanto && $map != Johto && $map != Route20 && $map != BerryForest && $map != Route10 && $map != Route4 && $map != 'Route10-2' && $map != 'Route4-2' && $map != 'Route13' && $map != 'Route15' && $map != 'Route11' && $map != 'Route12' && $map != 'Daycare')
{
$wildpoke = RAND(7,11);
}
$wildlevel = RAND(4,17);
$wildgender = RAND(1,2);
if($wildgender=='1')
{$gender= Male;}
if($wildgender=='2')
{$gender=Female;}

$geto="SELECT * from m_pokemon where ID='$wildpoke'";
$geto2=mysql_query($geto) or die("Could not get Pokemon from database.");
$geto3=mysql_fetch_array($geto2);

$geto4="SELECT * from a_pokemon where Pokemon='$geto3[Pokemon]'";
$geto5=mysql_query($geto4) or die("Could not get Pokemon from database.");
$geto6=mysql_fetch_array($geto5);

if (isset($_POST) && $getuser3[Refresh] == 'Yes')
{
print "<center><font face='verdana' size='2'><b>Oops! For Security Reasons Refreshing Has Been Disabled!";
}
if (isset($_POST) && $getuser3[Refresh] == 'Evolve')
{
print "<center><font face='verdana' size='2'><b>Oops! For Security Reasons Refreshing Has Been Disabled!";
}
if (isset($_POST) && $getusingp3[EvolveLVL] == '0')
{
print "<center><font face='verdana' size='2'><b>There Has Been An Error $getusingp3[Pokemon] Does Not Evolve!";
}
if (isset($_POST) && $getuser3[Refresh] == 'Yes')
{
print "<center><font face='verdana' size='2'><b>Oops! For Security Reasons Refreshing Has Been Disabled!";
}
if (isset($_POST) && $getp3[EvolveLVL] != '0' && $getusingp3[Level] >= $getp3[EvolveLVL] && $getuser3[Refresh] != 'Evolve')
{
$evolution = $getp3[Evolution];

$getevo="SELECT * from a_pokemon where Pokemon='$evolution'";
$getevo2=mysql_query($getevo) or die("Could not get Pokemon from database.");
$getevo3=mysql_fetch_array($getevo2);

$NewHP = ($getevo3[BaseHP]/10)*$getusingp3[Level];

print "<font face='verdana' size='2'><b><center>Evolving $getusingp3[Pokemon]!</font><font face='verdana' size='1'><br><br><img src='images/Pokemon/$getusingp3[Pokemon].gif'> <img src='images/Pokemon/$getevo3[Pokemon].gif'><br><b>Congratulations!</b><br>Your $getusingp3[Pokemon] Has Evolved Into $getevo3[Pokemon]!";

$FixHP="Update t_pokemon set Pokemon='$getevo3[Pokemon]', HP='$NewHP', MHP='$NewHP' where Trainer='$user' and ID='$getusingp3[ID]'";
mysql_query($FixHP) or die("Could not fix HP.");

$SetRefresh="Update trainers set Refresh='Evolve' where Username='$user'";
mysql_query($SetRefresh) or die("Could not stop refresh.");
}
if (isset($_POST) && $getuser3[Refresh] == 'No')
{
$getopp="SELECT * from a_pokemon where Pokemon='$getuser3[Opponent]'";
$getopp2=mysql_query($getopp) or die("Could not get Pokemon from database.");
$getopp3=mysql_fetch_array($getopp2);

$getopp4="SELECT * from m_pokemon where Pokemon='$getuser3[Opponent]'";
$getopp5=mysql_query($getopp4) or die("Could not get Pokemon from database.");
$getopp6=mysql_fetch_array($getopp5);

$next = $getuser3[OLevel]+1;
$next2 = $next*$next*$next;
$OHP = ($getopp3[BaseHP]/10)*$getuser3[OLevel];
if($getopp6 && $getuser3[OLevel] <= 17)
{
print "<center><font face='verdana' size='2'><b>Catch $getuser3[Opponent]!<br><br><br></b><font face='verdana' size='1'><img src='images/Pokemon/$getuser3[Opponent].gif'><br><b>$getuser3[Opponent]!</b><br><b>Level: </b>$getuser3[OLevel]<br><b>EXP: </b>$getuser3[OEXP]<br><b>Gender: </b>$getuser3[OGender]<br><br>$getuser3[Opponent]<img src='images/$getuser3[OGender].gif'> Has Been Added To Your Box!";

$SQL ="INSERT into t_pokemon (Pokemon,Trainer,Level,NLevel,EXP,EXPN,HP,MHP,Gender,Item, Attack1, Attack2, Attack3, Attack4) values('$getuser3[Opponent]','$getuser3[Username]','$getuser3[OLevel]','$next','$getuser3[OEXP]','$next2','$OHP','$OHP','$getuser3[OGender]','None','$getopp3[Attack1]','$getopp3[Attack2]','$getopp3[Attack3]','$getopp3[Attack4]')";
mysql_query($SQL) or die(mysql_error());

$SetRefresh="Update trainers set Refresh='Yes' where Username='$user'";
mysql_query($SetRefresh) or die("Could not stop refresh.");
}
if(!$getopp6 || $getuser3[OLevel] > 17)
{print "<font face='verdana' size='2'><b><center>Oops! There Was An Error Catching Pokemon!";}
}
if ((!isset($_POST)) && isset($_POST) && $getuser3[Refresh] == 'No' && (!isset($_POST)))
{
if($Attack == $getusingp3[Attack1])
{$ActualAttack = $getusingp3[Attack1];}
if($Attack == $getusingp3[Attack2])
{$ActualAttack = $getusingp3[Attack2];}
if($Attack == $getusingp3[Attack3])
{$ActualAttack = $getusingp3[Attack3];}
if($Attack == $getusingp3[Attack4])
{$ActualAttack = $getusingp3[Attack4];}
if($ActualAttack == '---')
{$ActualAttack = $getusingp3[Attack1];}

$getattack="SELECT * from attacks where Attack='$ActualAttack'";
$getattack2=mysql_query($getattack) or die("Could not get Pokemon from database.");
$getattack3=mysql_fetch_array($getattack2);

$getopp="SELECT * from a_pokemon where Pokemon='$getuser3[Opponent]'";
$getopp2=mysql_query($getopp) or die("Could not get Pokemon from database.");
$getopp3=mysql_fetch_array($getopp2);

$randomcritical = RAND(1,5);

$damage = (((($getusingp3[Level]/10)*($getp3[BaseATK]/10))*($getattack3[Power]/10))-(($getuser3[OLevel]/10)*($geto6[BaseDEF]/10)))/2;

if($getattack3[Type] == $getopp3[Weakness])
{
$damage = $damage*2;
}
if($getattack3[Type] == $getopp3[Type])
{
$damage = $damage*.75;
}
if($damage <= '0')
{$damage = 1;}
if($randomcritical == '1')
{
$damage = $damage*1.5;
}

$damage = round($damage);

$randomattack = RAND(1,4);

if($randomattack == 1)
{$wildattack = $getopp3[Attack1];}
if($randomattack == 2)
{$wildattack = $getopp3[Attack2];}
if($randomattack == 3)
{$wildattack = $getopp3[Attack3];}
if($randomattack == 4)
{$wildattack = $getopp3[Attack4];}
if($wildattack == '---')
{$wildattack = $getopp3[Attack1];}

$getattack4="SELECT * from attacks where Attack='$wildattack'";
$getattack5=mysql_query($getattack4) or die("Could not get Pokemon from database.");
$getattack6=mysql_fetch_array($getattack5);

$randomcritical2 = RAND(1,5);

if($randomcritical2 != '1' && $getattack6[Type] != $getp3[Weakness])
{
$damage2 = (((($getuser3[OLevel]/10)*($getopp3[BaseATK]/10))*($getattack6[Power]/10))-(($getusingp3[Level]/10)*($getp3[BaseDEF]/10)))/2;
}
if($randomcritical2 == '1' && $getattack6[Type] != $getp3[Weakness])
{
$damage2 = ((((($getuser3[OLevel]/10)*($getopp3[BaseATK]/10))*($getattack6[Power]/10))-(($getusingp3[Level]/10)*($getp3[BaseDEF]/10)))*1.5)/2;
}
if($getattack6[Type] == $getp3[Weakness])
{
$damage2 = ((((($getuser3[OLevel]/10)*($getopp3[BaseATK]/10))*($getattack6[Power]/10))-(($getusingp3[Level]/10)*($getp3[BaseDEF]/10)))*2)/2;
}
if($getattack6[Type] == $getp3[Type] && $getattack6[Type] != $getp3[Weakness])
{
$damage2 = ((((($getuser3[OLevel]/10)*($getopp3[BaseATK]/10))*($getattack6[Power]/10))-(($getusingp3[Level]/10)*($getp3[BaseDEF]/10)))*.75)/2;
}
if($damage2 <= '0')
{$damage2 = 1;}

$damage2 = round($damage2);

$dmg = $getusingp3[HP]-$damage2;
$dmg2 = $getuser3[OHP]-$damage;

$hp = (($getusingp3[HP]-$damage2)/$getusingp3[MHP])*100;
$hp2 = 100-$hp;
$exp = $getusingp3[EXPN]-(($getusingp3[Level]*$getusingp3[Level])*$getusingp3[Level]);
$exp2 = $getusingp3[EXP]-(($getusingp3[Level]*$getusingp3[Level])*$getusingp3[Level]);
$exp3 = ($exp2/$exp)*100;
$exp4 = 100-$exp3;
$color1 = $getp3;

$hp3 = (($getuser3[OHP]-$damage)/$getuser3[OMHP])*100;
$hp4 = 100-$hp3;

if((!isset($_POST)) && $getusingp3[HP]-$damage2 <= '0' && $getuser3[OHP]-$damage <= '0')
{
print "<center><font face='verdana' size='2'><b>The Battle Is A Draw!</b></font><br><br><img src='images/Trainers/$getuser3[Team].png'><img src='images/Pokemon/$getusingp3[Pokemon].gif'><br><font face='verdana' size='1'><b>$getuser3[Username] And $getusingp3[Pokemon] Have Tied The Battle!<br></b>No Money Or EXP Points Have Been Awarded!<br><br>";

$NewHP = $getusingp3[Level]*($getp3[BaseHP]/10);

$FixHP="Update t_pokemon set HP='$NewHP', MHP='$NewHP' where Trainer='$user' and Pokemon='$getusingp3[Pokemon]'";
mysql_query($FixHP) or die("Could not fix HP.");

$SetRefresh="Update trainers set Refresh='Yes' where Username='$user'";
mysql_query($SetRefresh) or die("Could not stop refresh.");

}
if((!isset($_POST)) && $getusingp3[HP]-$damage2 <= '0' && $getuser3[OHP]-$damage > '0')
{
print "<center><font face='verdana' size='2'><b>You Have Lost!</b></font><br><br><img src='images/Trainers/$getuser3[Team].png'><img src='images/Pokemon/$getusingp3[Pokemon].gif'><br><font face='verdana' size='1'><b>$getuser3[Username] And $getusingp3[Pokemon] Have Lost The Battle!<br></b>No Money Or EXP Points Have Been Awarded!<br><br>";

$NewHP = $getusingp3[Level]*($getp3[BaseHP]/10);

$FixHP="Update t_pokemon set HP='$NewHP', MHP='$NewHP' where Trainer='$user' and Pokemon='$getusingp3[Pokemon]'";
mysql_query($FixHP) or die("Could not fix HP.");

$SetRefresh="Update trainers set Refresh='Yes' where Username='$user'";
mysql_query($SetRefresh) or die("Could not stop refresh.");

}
if((!isset($_POST)) && $getusingp3[HP]-$damage2 > '0' && $getuser3[OHP]-$damage <= '0')
{
$money = ($getuser3[OLevel]*1.75);
$expgained = ($getuser3[OLevel]*$getopp3[BaseHP])/7;

$money2 = $getuser3[Money]+$money;
$expgained2 = $getusingp3[EXP]+$expgained;

print "<center><font face='verdana' size='2'><b>Congratulations!</b></font><br><br><img src='images/Trainers/$getuser3[Team].png'><img src='images/Pokemon/$getusingp3[Pokemon].gif'><br><font face='verdana' size='1'><b>$getuser3[Username] And $getusingp3[Pokemon] Have Won The Battle!<br></b>You Have Won $";
echo round($money);
print "!<br>And $getusingp3[Pokemon] Gained ";
echo round($expgained);
print " EXP Points!<br><br>";

if($expgained2 >= $getusingp3[EXPN])
{
$nextlevel = ($getusingp3[NLevel]+1)*($getusingp3[NLevel]+1)*($getusingp3[NLevel]+1);
$NewHP = ($getusingp3[Level]+1)*($getp3[BaseHP]/10);
$NewMHP = ($getusingp3[NLevel]+1)*($getp3[BaseHP]/10);
$nextlevel1 = $getusingp3[Level]+1;
$nextlevel2 = $getusingp3[NLevel]+1;
print "<font face='verdana' size='1' color='$font'><b>$getusingp3[Pokemon] Has Gained A Level!</b>";

$LevelUP="Update t_pokemon set Level='$nextlevel1', NLevel='$nextlevel2', EXPN='$nextlevel', HP='$NewHP', MHP='$NewHP' where Trainer='$user' and ID='$getusingp3[ID]'";
mysql_query($LevelUP) or die("Could not Level UP.");

if($nextlevel1 >= $getp3[EvolveLVL] && $getp3[EvolveLVL] != '0')
{
print "<br><font face='verdana' size='1'><b>$getusingp3[Pokemon] Is Ready To Evolve!<br></b>
<form method=\"POST\" onSubmit=\"submitonce(this)\"><input type='hidden' name='evolve' value='$getusingp3[Pokemon]'><button type=\"submit\" name=\"evolve\" value=\"evolve\" class='button2'>Evolve $getusingp3[Pokemon]!</button></form>";
}
}

$SetEXP="Update t_pokemon set EXP='$expgained2' where Trainer='$user' and ID='$getusingp3[ID]'";
mysql_query($SetEXP) or die("Could not award EXP.");

$SetMoney="Update trainers set Money='$money2' where Username='$user'";
mysql_query($SetMoney) or die("Could not award Money.");

$NewHP = $getusingp3[Level]*($getp3[BaseHP]/10);

$FixHP="Update t_pokemon set HP='$NewHP', MHP='$NewHP' where Trainer='$user' and Pokemon='$getusingp3[Pokemon]'";
mysql_query($FixHP) or die("Could not fix HP.");

$SetRefresh="Update trainers set Refresh='Yes' where Username='$user'";
mysql_query($SetRefresh) or die("Could not stop refresh.");
}
if((!isset($_POST)) && $getusingp3[HP]-$damage2 > '0' && $getuser3[OHP]-$damage > '0')
{
$getname="SELECT * from t_pokemon where Trainer='$getuser3[Username]' and Pokemon='$getuser3[Opponent]'";
$getname2=mysql_query($getname) or die("Could not select new pokemon.");
$getname3=mysql_fetch_array($getname2);

print "<center>
<table width='465' cellspacing='.5' cellpadding='1' border='0' class='table'><tr><td>
<table width='230' style='border:1px solid black' bgcolor='$getopp3' cellspacing='1' cellpadding='1'><tr><td width='155'><table><tr><td colspan='3' bgcolor='White' style='border:1px solid black' width='155'";
if($getname3)
{print "background='images/Caught.PNG'";}
print "><font face='verdana' size='1'>$getuser3[Opponent]<img src='images/$getuser3[OGender].gif'></td></tr><tr><td colspan='1'><font face='verdana' size='1' color='black'><b> HP:</b> ";
if($getuser3[OHP]-$damage > 0)
{
echo round($getuser3[OHP]-$damage);
}
if($getuser3[OHP]-$damage <= 0)
{print "FNT";}
if($getuser3[OHP]-$damage <= 0)
{print "FNT";}
if($getuser3[OHP]-$damage >= ($getuser3[OMHP]/2))
{$color = steelblue;}
if($getuser3[OHP]-$damage >= ($getuser3[OMHP]*.25) && $getuser3[OHP]-$damage < ($getuser3[OMHP]/2))
{$color = gold;}
if($getuser3[OHP]-$damage >= 0 && $getuser3[OHP]-$damage < ($getuser3[OMHP]*.25))
{$color = red;}
print "<br><table width='100' style='border:1px solid black' cellspacing='0' cellpadding='0' height='7' bgcolor='white'><tr><td width='$hp3' bgcolor='$color'></td><td width='$hp4'></tr></table><b> EXP:</b> $getuser3[OEXP]<br><table width='100' style='border:1px solid black' cellspacing='0' cellpadding='0' height='5' bgcolor='white'><tr><td width='0' bgcolor='magenta'></td><td width='100'></td></tr></table></td><td valign='top' width='100%'><font face='verdana' size='1' color='black'><b>LV:</b>$getuser3[OLevel]<br><center><img src='images/$getopp3[Type].png' title='Pokemon's Type'></td></tr></table></td><td width='65' height='100%'><center><img src='images/Pokemon/$getuser3[Opponent].gif'></td></tr></table>
</td><td rowspan='2' valign='top' width='220' height='100%'><font face='verdana' size='1'><center><b>"; ?>
<a href onMouseover="show_text(0,'div1')">ATTACK</a>
|<a href onMouseover="show_text(1,'div1')">SWITCH</a>|<a href onMouseover="show_text(2,'div1')">ITEM</a>|<a href onMouseover="show_text(3,'div1')">RUN</a></b><br>
<span id="div1" style="vertical-align: top;">Continue Battle</span>

<?php
print "</td></tr><tr><td>
<table width='230' style='border:1px solid black' bgcolor='$color1' cellspacing='1' cellpadding='1'><tr><td width='65' height='100%'><center><img src='images/Pokemon/$getusingp3[Pokemon].gif'></td><td width='155'><table><tr><td colspan='3' bgcolor='white' style='border:1px solid black'><font face='verdana' size='1' color='black'>$getusingp3[Pokemon]<img src='images/$getusingp3[Gender].gif'></td></tr><tr><td colspan='1'><font face='verdana' size='1' color='black'><b> HP:</b> ";
if($getusingp3[HP]-$damage2 > 0)
{
echo round($getusingp3[HP]-$damage2);
}
if($getusingp3[HP]-$damage2 <= 0)
{print "FNT";}
if($getusingp3[HP]-$damage2 >= ($getusingp3[MHP]/2))
{$color2 = steelblue;}
if($getusingp3[HP]-$damage2 >= ($getusingp3[MHP]*.25) && $getusingp3[HP]-$damage2 < ($getusingp3[MHP]/2))
{$color2 = gold;}
if($getusingp3[HP]-$damage2 >= 0 && $getusingp3[HP]-$damage2 < ($getusingp3[MHP]*.25))
{$color2 = red;}
print "<br><table width='100' style='border:1px solid black' cellspacing='0' cellpadding='0' height='7' bgcolor='white'><tr><td width='$hp' bgcolor='$color2'></td><td width='$hp2'></tr></table><b> EXP:</b> $getusingp3[EXP]<br><table width='100' style='border:1px solid black' cellspacing='0' cellpadding='0' height='5' bgcolor='white'><tr><td width='$exp3' bgcolor='magenta'></td><td width='$exp4'></td></tr></table></td><td valign='top' width='100%'><font face='verdana' size='1' color='black'><b>LV:</b>$getusingp3[Level]<br><center><img src='images/$getp3[Type].png' title='Pokemon's Type'></td></tr></table></tr></td></table></tr></td><tr><td colspan='2'><table cellspacing='0' cellpadding='0' width='100%' border='0'><tr><td width='100%' style='border:1px solid black' valign='top' colspan='2'><font face='verdana' size='1'><b><center>Attack Statistics<br></b>Your $getusingp3[Pokemon] Attacked With <b>$ActualAttack</b> And Did ";
echo round($damage);
print " HP Damage!<br>";
if($getattack3[Type] == $getopp3[Type] && $getattack3[Type] != $getopp3[Weakness])
{print "<font face='verdana' size='1' color='darkblue'><b>It's Not Very Effective!</b></font><br>";}
if($getattack3[Type] == $getopp3[Weakness])
{print "<font face='verdana' size='1' color='darkgreen'><b>It's Super Effective!</b></font><br>";}
if($randomcritical == '1')
{print "<font face='verdana' size='1' color='darkred'><b>A Critical Hit!</b></font><br>";}
print "<font face='verdana' size='1'>$getuser3[Opponent] Attacked With <b>$wildattack</b> And Did ";
echo round($damage2);
print " HP Damage!<br>";
if($getattack6[Type] == $getp3[Type] && $getattack6[Type] != $getp3[Weakness])
{print "<font face='verdana' size='1' color='darkblue'><b>It's Not Very Effective!</b></font><br>";}
if($getattack6[Type] == $getp3[Weakness])
{print "<font face='verdana' size='1' color='darkgreen'><b>It's Super Effective!</b></font><br>";}
if($randomcritical2 == '1')
{print "<font face='verdana' size='1' color='darkred'><b>A Critical Hit!</b></font><br>";}
print "</td></tr></table></tr></td></table><br><br>";
if($getuser3[OHP]-$damage <= $getuser3[OMHP]*.25 && $getuser3[OHP]-$damage > 0)
{print "<form method='POST'><button type='submit' name='catch' value='catch' class='button2'><input type='hidden' value='$getuser3[Opponent]' name='opponent'></input>Catch $getuser3[Opponent]!</button></form>";}
print "<br><br><font face='verdana' size='1'></b></b>Copyright - PPA Battle System Version 2.0 BETA";

$dmg= $getusingp3[HP]-$damage2;
$dmg2= $getuser3[OHP]-$damage;

$SetUHP="Update t_pokemon set HP='$dmg' where Trainer='$user' and Pokemon='$getusingp3[Pokemon]'";
mysql_query($SetUHP) or die("Could not deal damage2.");

$SetOHP="Update trainers set OHP='$dmg2' where Username='$user'";
mysql_query($SetOHP) or die("Could not deal damage.");
}
}
if((!isset($_POST)) && (!isset($_POST)) && (!isset($_POST)) && $Switched == 1)
{
if($getuser3[OHP] >= ($getuser3[OMHP]/2))
{$color = steelblue;}
if($getuser3[OHP] >= ($getuser3[OMHP]*.25) && $getuser3[OHP] < ($getuser3[OMHP]/2))
{$color = gold;}
if($getuser3[OHP] >= 0 && $getuser3[OHP] < ($getuser3[OMHP]*.25))
{$color = red;}

if($getusingp3[HP] >= ($getusingp3[MHP]/2))
{$color2 = steelblue;}
if($getusingp3[HP] >= ($getusingp3[MHP]*.25) && $getusingp3[HP] < ($getusingp3[MHP]/2))
{$color2 = gold;}
if($getusingp3[HP] >= 0 && $getusingp3[HP] < ($getusingp3[MHP]*.25))
{$color2 = red;}

$getopp="SELECT * from a_pokemon where Pokemon='$getuser3[Opponent]'";
$getopp2=mysql_query($getopp) or die("Could not get Pokemon from database.");
$getopp3=mysql_fetch_array($getopp2);

$SetRefresh="Update trainers set Refresh='No' where Username='$user'";
mysql_query($SetRefresh) or die("Could not stop refresh.");

$getattack="SELECT * from attacks where Attack='$getp3[Attack1]'";
$getattack2=mysql_query($getattack) or die("Could not get Pokemon from database.");
$getattack3=mysql_fetch_array($getattack2);

$exp = $getusingp3[EXPN]-(($getusingp3[Level]*$getusingp3[Level])*$getusingp3[Level]);
$exp2 = $getusingp3[EXP]-(($getusingp3[Level]*$getusingp3[Level])*$getusingp3[Level]);
$exp3 = ($exp2/$exp)*100;
$exp4 = 100-$exp3;
$color1 = $getp3;
$NewHP = $getusingp3[Level]*($getp3[BaseHP]/10);


$hp3 = ($getuser3[OHP]/$getuser3[OMHP])*100;
$hp4 = 100-$hp3;

print "<center><font face='verdana' size='1'>
<table width='465' cellspacing='.5' cellpadding='1' border='0' class='table'><tr><td>
<table width='230' style='border:1px solid black' bgcolor='$getopp3' cellspacing='1' cellpadding='1'><tr><td width='155'><table><tr><td colspan='3' bgcolor='White' style='border:1px solid black' width='155'><font face='verdana' size='1'>$getuser3[Opponent]<img src='images/$getuser3[OGender].gif'></td></tr><tr><td colspan='1'><font face='verdana' size='1' color='black'><b> HP:</b> ";
echo round($getuser3[OHP]); print "<br><table width='100' style='border:1px solid black' cellspacing='0' cellpadding='0' height='7' bgcolor='white'><tr><td width='$hp3' bgcolor='$color'></td><td width='$hp4'></tr></table><b> EXP:</b> $getuser6[OEXP]<br><table width='100' style='border:1px solid black' cellspacing='0' cellpadding='0' height='5' bgcolor='white'><tr><td width='0' bgcolor='magenta'></td><td width='100'></td></tr></table></td><td valign='top' width='100%'><font face='verdana' size='1' color='black'><b>LV:</b>$getuser3[OLevel]<br><center><img src='images/$getopp3[Type].png' title='Pokemon's Type'></td></tr></table></td><td width='65' height='100%'><center><img src='images/Pokemon/$getuser3[Opponent].gif'></td></tr></table>
</td><td rowspan='2' valign='top' width='220'><font face='verdana' size='1'><center><b>"; ?>

<a href onMouseover="show_text(0,'div1')">ATTACK</a>|<a href onMouseover="show_text(1,'div1')">SWITCH</a>|<a href onMouseover="show_text(2,'div1')">ITEM</a>|<a href onMouseover="show_text(3,'div1')">RUN</a>
</b><br>
<span id="div1">Continue Battle</span>

<?php
print "</td></tr><tr><td>
<table width='230' style='border:1px solid black' bgcolor='$color1' cellspacing='1' cellpadding='1'><tr><td width='65' height='100%'><center><img src='images/Pokemon/$getusingp3[Pokemon].gif'></td><td width='155'><table><tr><td colspan='3' bgcolor='white' style='border:1px solid black'><font face='verdana' size='1' color='black'>$getusingp3[Pokemon]<img src='images/$getusingp3[Gender].gif'></td></tr><tr><td colspan='1'><font face='verdana' size='1' color='black'><b> HP:</b> "; echo round($getusingp3[HP]); print "<br><table width='100' style='border:1px solid black' cellspacing='0' cellpadding='0' height='7' bgcolor='white'><tr><td width='100' bgcolor='$color2'></td><td width='0'></tr></table><b> EXP:</b> $getusingp3[EXP]<br><table width='100' style='border:1px solid black' cellspacing='0' cellpadding='0' height='5' bgcolor='white'><tr><td width='$exp3' bgcolor='magenta'></td><td width='$exp4'></td></tr></table></td><td valign='top' width='100%'><font face='verdana' size='1' color='black'><b>LV:</b>$getusingp3[Level]<br><center><img src='images/$getp3[Type].png' title='Pokemon's Type'></td></tr></table></tr></td></table></tr></td><tr><td colspan='2'><table cellspacing='0' cellpadding='0' width='100%' border='0'><tr><td width='100%' style='border:1px solid black' valign='top' colspan='2'><font face='verdana' size='1'><b><center>Attack Statistics<br></b></td></tr></table></tr></td></table>
<br><br><font face='verdana' size='1'></b></b><br><br>Copyright - PPA Battle System Version 2.0 BETA";
}
if($wildfound=='1' && (!isset($_POST)) && (!isset($_POST)) && (!isset($_POST)) && $Using == Starter && $switched != 1)
{
$SetRefresh="Update trainers set Refresh='No' where Username='$user'";
mysql_query($SetRefresh) or die("Could not stop refresh.");

$getattack="SELECT * from attacks where Attack='$getp3[Attack1]'";
$getattack2=mysql_query($getattack) or die("Could not get Pokemon from database.");
$getattack3=mysql_fetch_array($getattack2);

$exp = $getusingp3[EXPN]-(($getusingp3[Level]*$getusingp3[Level])*$getusingp3[Level]);
$exp2 = $getusingp3[EXP]-(($getusingp3[Level]*$getusingp3[Level])*$getusingp3[Level]);
$exp3 = ($exp2/$exp)*100;
$exp4 = 100-$exp3;
$color1 = $getp3;
$NewHP = $getusingp3[Level]*($getp3[BaseHP]/10);

$OHP = ($geto6[BaseHP]/10)*$wildlevel;
$OEXP = $wildlevel*$wildlevel*$wildlevel;

$FixHP="Update t_pokemon set HP='$NewHP', MHP='$NewHP' where Trainer='$user' and Pokemon='$getpokemon3[Pokemon]'";
mysql_query($FixHP) or die("Could not fix HP.");

$SetOpponent="Update trainers set OLevel='$wildlevel', OEXP='$OEXP', OGender='$gender', Opponent='$geto3[Pokemon]', OHP='$OHP', OMHP='$OHP' where Username='$user'";
mysql_query($SetOpponent) or die("Could not set up opponent.");

$hp = ($getusingp3[HP]/$getusingp3[MHP])*100;
$hp2 = 100-$hp;

$hp3 = ($OHP/$OHP)*100;
$hp4 = 100-$hp3;

$getwildopp="SELECT * from t_pokemon where Trainer='$getuser3[Username]' and Pokemon='$geto3[Pokemon]'";
$getwildopp2=mysql_query($getwildopp) or die("Could not select new pokemon.");
$getwildopp3=mysql_fetch_array($getwildopp2);

print "<center><font face='verdana' size='1'><b>Wild $geto3[Pokemon] Attacked!</b>
<table width='465' cellspacing='.5' cellpadding='1' border='0' class='table'><tr><td>
<table width='230' style='border:1px solid black' bgcolor='$geto6' cellspacing='1' cellpadding='1'><tr><td width='155'><table><tr><td colspan='3' bgcolor='White' style='border:1px solid black' width='155'";
if($getwildopp3)
{print "background='images/Caught.PNG'";}
print "><font face='verdana' size='1'>$geto3[Pokemon]<img src='images/$gender.gif'></td></tr><tr><td colspan='1'><font face='verdana' size='1' color='black'><b> HP:</b> ";
echo round($OHP); print "<br><table width='100' style='border:1px solid black' cellspacing='0' cellpadding='0' height='7' bgcolor='white'><tr><td width='$hp3' bgcolor='steelblue'></td><td width='$hp4'></tr></table><b> EXP:</b> $OEXP<br><table width='100' style='border:1px solid black' cellspacing='0' cellpadding='0' height='5' bgcolor='white'><tr><td width='0' bgcolor='magenta'></td><td width='100'></td></tr></table></td><td valign='top' width='100%'><font face='verdana' size='1' color='black'><b>LV:</b>$wildlevel<br><center><img src='images/$geto6[Type].png' title='Pokemon's Type'></td></tr></table></td><td width='65' height='100%'><center><img src='images/Pokemon/$geto3[Pokemon].gif'></td></tr></table>
</td><td rowspan='2' valign='top' width='220'><font face='verdana' size='1'><center><b>"; ?>

<a href onMouseover="show_text(0,'div1')">ATTACK</a>|<a href onMouseover="show_text(1,'div1')">SWITCH</a>|<a href onMouseover="show_text(2,'div1')">ITEM</a>|<a href onMouseover="show_text(3,'div1')">RUN</a>
</b><br>
<span id="div1">Begin Battle</span>

<?php
print "</td></tr><tr><td>
<table width='230' style='border:1px solid black' bgcolor='$color1' cellspacing='1' cellpadding='1'><tr><td width='65' height='100%'><center><img src='images/Pokemon/$getusingp3[Pokemon].gif'></td><td width='155'><table><tr><td colspan='3' bgcolor='white' style='border:1px solid black'><font face='verdana' size='1' color='black'>$getusingp3[Pokemon]<img src='images/$getusingp3[Gender].gif'></td></tr><tr><td colspan='1'><font face='verdana' size='1' color='black'><b> HP:</b> "; echo round($getusingp3[HP]); print "<br><table width='100' style='border:1px solid black' cellspacing='0' cellpadding='0' height='7' bgcolor='white'><tr><td width='$hp' bgcolor='steelblue'></td><td width='$hp2'></tr></table><b> EXP:</b> $getusingp3[EXP]<br><table width='100' style='border:1px solid black' cellspacing='0' cellpadding='0' height='5' bgcolor='white'><tr><td width='$exp3' bgcolor='magenta'></td><td width='$exp4'></td></tr></table></td><td valign='top' width='100%'><font face='verdana' size='1' color='black'><b>LV:</b>$getusingp3[Level]<br><center><img src='images/$getp3[Type].png' title='Pokemon's Type'></td></tr></table></tr></td></table></tr></td><tr><td colspan='2'><table cellspacing='0' cellpadding='0' width='100%' border='0'><tr><td width='100%' style='border:1px solid black' valign='top' colspan='2'><font face='verdana' size='1'><b><center>Attack Statistics<br></b></td></tr></table></tr></td></table>
<br><br><font face='verdana' size='1'></b></b><br><br>Copyright - PPA Battle System Version 2.0 BETA";
}
if($wildfound != '1' && (!isset($_POST)) && (!isset($_POST)) && (!isset($_POST)) && $switched != 1 && (!isset($_GET)))
{
$NewHP = $getpokemon3[Level]*($getp3[BaseHP]/10);

$FixHP="Update t_pokemon set HP='$NewHP', MHP='$NewHP' where Trainer='$user' and Pokemon='$getpokemon3[Pokemon]'";
mysql_query($FixHP) or die("Could not fix HP.");

$recent=date("U")-300;

$getonmap="SELECT COUNT(*) from trainers where Map='$map' AND lasttime>'$recent'";
$getonmap2=mysql_query($getonmap) or die("Could not get trainers on map,");
$getonmap3=mysql_result($getonmap2,0);

print "<center><font face='verdana' size='1'><b>You Are Exploring $map! | There Are $getonmap3 Trainers Exploring $map<br><table><tr><td background='images/Maps/$map.PNG' ";
if($map != Daycare && $map != BerryForest && $map != Route4 && $map != 'Route4-2' && $map != Route10 && $map != 'Route10-2' && $map != Route11 && $map != Route20 && $map != Route5 && $map != Route7)
{
print "height='398' width='434'";
}
if($map == Daycare || $map == BerryForest || $map == Route4 || $map == 'Route4-2' || $map == Route10 || $map == 'Route10-2' || $map == Route11 || $map == Route20 || $map == Route5 || $map == Route7)
{
print "height='599' width='434'";
}
print " valign='top' style='border:1px solid black'><b><font face='verdana' size='1'>.";

if(!isset($_GET))
{
$Show= 'Yes';
}
else
{
$Show=$_GET;
}

if($Show == Yes || $Show == '')
{
$recent=date("U")-300;

$getranks="SELECT * from trainers where Map='$map' AND Username!='$getuser3[Username]' AND lasttime>'$recent' order by userID ASC";
$getranks2=mysql_query($getranks) or die("Could not get box Pokemon.");
while($getranks3=mysql_fetch_array($getranks2))
{

$left2=190+$getranks3[X]*15;
$down2=170+$getranks3[Y]*15;

print "<div style='position:absolute; left:$left2; top:$down2; width:18; height:23;";
if($getranks3[status] > '0')
{print "border:1px solid black; background-color:darkorange;";}
print "'><center><font face='verdana' size='1'><a href='index.php?mode=View&Name=$getranks3[Username]'><img src='images/Trainers/Small/$getranks3[Team].gif' title='$getranks3[Username]' border='0'></a></div>";

if($left == $left2 && $top == $down2)
{
print "<div style='position:absolute; left:320; top:210; width:200; height:12; border:1px solid black; background-color:white;'><center><font face='verdana' size='1'><a href='index.php?mode=Battle&battle=$getranks3[Starter]'>Battle $getranks3[Username]!</a></div>";
}
}
}
print "<div style='position:absolute; left:$left; top:$top; width:18; height:23; border:1px solid black; background-color:gold;'><center><font face='verdana' size='1'><img src='images/Trainers/Small/$getuser3[Team].gif' title='$getuser3[Username]'></div>";
print "</td></tr></table><font face='verdana' size='1'><b>Show Other Trainers<br></b><a href='index.php?mode=maps&map=$map&x=$x&y=$y&Show=Yes'>On</a>(Default) | <a href='index.php?mode=maps&map=$map&x=$x&y=$y&Show=No'>Off</a>";
}
}
if(!isset($_SESSION))
{
print "<center><font face='verdana' size='2'><b>You Must Be Logged In To View The Maps!";
}
?>

Here is the whole file.

Everything work properly in this code. I've just check it in Zend Studio.
Check out included files.

Is your IF statement closed? I think that the line with the query is ok, the error's just reported there.

It helps readability to indent your code.

I just scrolled up and noticed you quoted the code rather than use [ code ] tags. Please don't quote code, use [ code ] tags. Besides preserving spacing, we get color highlighting. :-)

Try to write the line like:

$getopp="SELECT * from a_pokemon where Pokemon=".$getuser3[Opponent];

I dont suggest switching between ' and " . You should decide wich one you prefer and always use it.
I usually put a dot to separate two variables. I'm not sure it will make any difference but you can try it.

Switching is fine if you understand the difference. "" expands variables and '' takes everything literally.

MySQL uses the single quotes as part of its syntax, so you really don't have much choice.

Yes, you are right and I made a mistake in the query I wrote. It should be:

$getopp="SELECT * from a_pokemon where Pokemon='".$getuser3[Opponent]."'";
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.