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'])) { $Using= 'Starter'; } else { $Using=$_GET['Using']; } if($Using != Starter && $Using != Second && $Using != Third && $Using != Fourth && $Using != Fifth && $Using != Sixth) {$Using = Starter;}
if(!isset($_GET['Switched'])) { $Switched= '0'; } else { $Switched=$_GET['Switched']; }
$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; }
?>
<?php if(isset($_SESSION['user'])) {
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['Attack']) && $getuser3[Refresh] == 'Yes') { print "Oops! For Security Reasons Refreshing Has Been Disabled!"; } if (isset($_POST['evolve']) && $getuser3[Refresh] == 'Evolve') { print "Oops! For Security Reasons Refreshing Has Been Disabled!"; } if (isset($_POST['evolve']) && $getusingp3[EvolveLVL] == '0') { print "There Has Been An Error $getusingp3[Pokemon] Does Not Evolve!"; } if (isset($_POST['catch']) && $getuser3[Refresh] == 'Yes') { print "Oops! For Security Reasons Refreshing Has Been Disabled!"; } if (isset($_POST['evolve']) && $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 "Evolving $getusingp3[Pokemon]!
Congratulations!
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['catch']) && $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 "Catch $getuser3[Opponent]!
$getuser3[Opponent]!
Level: $getuser3[OLevel]
EXP: $getuser3[OEXP]
Gender: $getuser3[OGender]
$getuser3[Opponent]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 "Oops! There Was An Error Catching Pokemon!";} } if ((!isset($_POST['catch'])) && isset($_POST['Attack']) && $getuser3[Refresh] == 'No' && (!isset($_POST['evolve']))) { 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[Color];
$hp3 = (($getuser3[OHP]-$damage)/$getuser3[OMHP])*100; $hp4 = 100-$hp3;
if((!isset($_POST['catch'])) && $getusingp3[HP]-$damage2 <= '0' && $getuser3[OHP]-$damage <= '0') { print "The Battle Is A Draw!
$getuser3[Username] And $getusingp3[Pokemon] Have Tied The Battle!
No Money Or EXP Points Have Been Awarded!
";$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['catch'])) && $getusingp3[HP]-$damage2 <= '0' && $getuser3[OHP]-$damage > '0') { print "You Have Lost!
$getuser3[Username] And $getusingp3[Pokemon] Have Lost The Battle!
No Money Or EXP Points Have Been Awarded!
";$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['catch'])) && $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 "Congratulations!
$getuser3[Username] And $getusingp3[Pokemon] Have Won The Battle!
You Have Won $"; echo round($money); print "!
And $getusingp3[Pokemon] Gained "; echo round($expgained); print " EXP Points!
";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 "$getusingp3[Pokemon] Has Gained A Level!";
$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 "
$getusingp3[Pokemon] Is Ready To Evolve!
Evolve $getusingp3[Pokemon]!"; } }$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['catch'])) && $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 " $getuser3[Opponent]
HP: "; 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 "
EXP: $getuser3[OEXP]
LV:$getuser3[OLevel]"; ?> ATTACK |SWITCH|ITEM|RUN
Continue Battle<?php print "
$getusingp3[Pokemon]
HP: "; 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 "
EXP: $getusingp3[EXP]
LV:$getusingp3[Level]Attack Statistics
Your $getusingp3[Pokemon] Attacked With $ActualAttack And Did "; echo round($damage); print " HP Damage!
"; if($getattack3[Type] == $getopp3[Type] && $getattack3[Type] != $getopp3[Weakness]) {print "It's Not Very Effective!
";} if($getattack3[Type] == $getopp3[Weakness]) {print "It's Super Effective!
";} if($randomcritical == '1') {print "A Critical Hit!
";} print "$getuser3[Opponent] Attacked With $wildattack And Did "; echo round($damage2); print " HP Damage!
"; if($getattack6[Type] == $getp3[Type] && $getattack6[Type] != $getp3[Weakness]) {print "It's Not Very Effective!
";} if($getattack6[Type] == $getp3[Weakness]) {print "It's Super Effective!
";} if($randomcritical2 == '1') {print "A Critical Hit!
";} print "
"; if($getuser3[OHP]-$damage <= $getuser3[OMHP]*.25 && $getuser3[OHP]-$damage > 0) {print "Catch $getuser3[Opponent]!";} print "
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['catch'])) && (!isset($_POST['Attack'])) && (!isset($_POST['evolve'])) && $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[Color]; $NewHP = $getusingp3[Level]*($getp3[BaseHP]/10);
$hp3 = ($getuser3[OHP]/$getuser3[OMHP])*100; $hp4 = 100-$hp3;
print " $getuser3[Opponent]
HP: "; echo round($getuser3[OHP]); print "
EXP: $getuser6[OEXP]
LV:$getuser3[OLevel]"; ?>
ATTACK|SWITCH|ITEM|RUN
Continue Battle<?php print "
$getusingp3[Pokemon]
HP: "; echo round($getusingp3[HP]); print "
EXP: $getusingp3[EXP]
LV:$getusingp3[Level]Attack Statistics
Copyright - PPA Battle System Version 2.0 BETA"; } if($wildfound=='1' && (!isset($_POST['Attack'])) && (!isset($_POST['catch'])) && (!isset($_POST['evolve'])) && $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[Color]; $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 "Wild $geto3[Pokemon] Attacked! $geto3[Pokemon]
HP: "; echo round($OHP); print "
EXP: $OEXP
LV:$wildlevel"; ?>
ATTACK|SWITCH|ITEM|RUN
Begin Battle<?php print "
$getusingp3[Pokemon]
HP: "; echo round($getusingp3[HP]); print "
EXP: $getusingp3[EXP]
LV:$getusingp3[Level]Attack Statistics
Copyright - PPA Battle System Version 2.0 BETA"; } if($wildfound != '1' && (!isset($_POST['Attack'])) && (!isset($_POST['catch'])) && (!isset($_POST['evolve'])) && $switched != 1 && (!isset($_GET['Using']))) { $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 "You Are Exploring $map! | There Are $getonmap3 Trainers Exploring $map
.";if(!isset($_GET['Show'])) { $Show= 'Yes'; } else { $Show=$_GET['Show']; }
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;
if($left == $left2 && $top == $down2) { print "Battle $getranks3[Username]!"; } } } print "
"; print "Show Other Trainers
On(Default) | Off"; } } if(!isset($_SESSION['user'])) { print "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:
[php]
$getopp="SELECT * from a_pokemon where Pokemon=".$getuser3[Opponent];
[/php]
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:
[php]
$getopp="SELECT * from a_pokemon where Pokemon='".$getuser3[Opponent]."'";
[/php]