Xyphon Posted July 26, 2009 Share Posted July 26, 2009 OK so, here's the script(NOT the whole code, just a snipit): if($Submit=='Taijutsu') { $EnemyRand= rand(1, 4); $GenjutsuE= $Battle_Rows['Enemy_Genjutsu']; $GenjutsuE= mysql_real_escape_string($GenjutsuE); $NinjutsuE= $Battle_Rows['Enemy_Ninjutsu']; $NinjutsuE= mysql_real_escape_string($NinjutsuE); $TaijutsuE= $Battle_Rows['Enemy_Taijutsu']; $TaijutsuE= mysql_real_escape_string($TaijutsuE); $WeaponE= $Battle_Rows['Enemy_Weapon']; $WeaponE= mysql_real_escape_string($WeaponE); $Taijutsu_Enemy_Result= mysql_query("SELECT * FROM jutsus WHERE Jutsu_Name='$TaijutsuE'"); $Taijutsu_Enemy_Rows= mysql_fetch_array($Taijutsu_Enemy_Result); $Ninjutsu_Enemy_Result= mysql_query("SELECT * FROM jutsus WHERE Jutsu_Name='$NinjutsuE'"); $Ninjutsu_Enemy_Rows= mysql_fetch_array($Ninjutsu_Enemy_Result); $Genjutsu_Enemy_Result= mysql_query("SELECT * FROM jutsus WHERE Jutsu_Name='$GenjutsuE'"); $Genjutsu_Enemy_Rows= mysql_fetch_array($Genjutsu_Enemy_Result); $Weapon_Enemy_Result= mysql_query("SELECT * FROM jutsus WHERE Jutsu_Name='$WeaponE'"); $Weapon_Enemy_Rows= mysql_fetch_array($Weapon_Enemy_Result); $DodgeE = $Battle_Rows['Dodge']; $DodgeE = mysql_real_escape_string($DodgeE); $DefenseE1 = $Battle_Rows['Enemy_Defense']; $DefenseE2 = $Weapon_Enemy_Rows['Enemy_Defense_Boost']; $DefenseE1 = $DefenseE1 + $DefenseE2; $DefenseE1 = mysql_real_escape_string($DefenseE1); if($EnemyRand=="4") { $Enemy_Move= $NinjutsuE; $EnemyDamage1= $Ninjutsu_Enemy_Rows['Jutsu_Power']; $EnemyDamage1= mysql_real_escape_string($EnemyDamage1); $Ninjutsupower= $Battle_Rows['Enemy_Ninjutsu_Power']; $Ninjutsupower= mysql_real_escape_string($Ninjutsupower); $EnemyPower= $Battle_Rows['Enemy_Power']; $EnemyPower= mysql_real_escape_string($EnemyPower); $EnemyDamage2= round(($Ninjutsupower * 10) + $EnemyDamage1 + $EnemyPower); $EnemyDamage3= round($EnemyDamage2 / 5); $HP= $Battle_Rows2['HP']; $HP= mysql_real_escape_string($HP); $Defense= $Ninjutsu_Enemy_Rows['Defense']; $Defense= mysql_real_escape_string($Defense); $EnemyChakra= $Battle_Rows['Enemy_Chakra']; $EnemyChakra= mysql_real_escape_string($EnemyChakra); $ChakraUsedE= $Ninjutsu_Enemy_Rows['Chakra_Used']; $ChakraUsedE= mysql_real_escape_string($ChakraUsedE); $PastEnemyChakra= $EnemyChakra; $EnemyDamage3= round($EnemyDamage3 / 1.25); if($EnemyDamage1==0) { $EnemyDamage3= 0; } } elseif($EnemyRand=="3") { $Enemy_Move= $TaijutsuE; $EnemyDamage1= $Taijutsu_Enemy_Rows['Jutsu_Power']; $EnemyDamage1= mysql_real_escape_string($EnemyDamage1); $Taijutsupower= $Battle_Rows['Enemy_Taijutsu_Power']; $Taijutsupower= mysql_real_escape_string($Taijutsupower); $EnemyPower= $Battle_Rows['Enemy_Power']; $EnemyPower= mysql_real_escape_string($EnemyPower); $EnemyDamage2= round((Taijutsupower * 10) + $EnemyDamage1 + $EnemyPower); $EnemyDamage3= round($EnemyDamage2 / 5); $HP= $Battle_Rows2['HP']; $HP= mysql_real_escape_string($HP); $Defense= $Taijutsu_Enemy_Rows['Defense']; $Defense= mysql_real_escape_string($Defense); $EnemyChakra= $Battle_Rows['Enemy_Chakra']; $EnemyChakra= mysql_real_escape_string($EnemyChakra); $ChakraUsedE= $Taijutsu_Enemy_Rows['Chakra_Used']; $ChakraUsedE= mysql_real_escape_string($ChakraUsedE); $PastEnemyChakra= $EnemyChakra; $EnemyDamage3= round($EnemyDamage3 / 1.25); } elseif($EnemyRand=="2") { $Enemy_Move= $GenjutsuE; $EnemyDamage1= $Genjutsu_Enemy_Rows['Jutsu_Power']; $EnemyDamage1= mysql_real_escape_string($EnemyDamage1); $Genjutsupower= $Battle_Rows['Enemy_Genjutsu_Power']; $Genjutsupower= mysql_real_escape_string($Genjutsupower); $EnemyPower= $Battle_Rows['Enemy_Power']; $EnemyPower= mysql_real_escape_string($EnemyPower); $EnemyDamage2= round(($Genjutsupower * 10) + $EnemyDamage1 + $EnemyPower); $EnemyDamage3= round($EnemyDamage2 / 5); $HP= $Battle_Rows2['HP']; $HP= mysql_real_escape_string($HP); $Defense= $Genjutsu_Enemy_Rows['Defense']; $Defense= mysql_real_escape_string($Defense); $EnemyChakra= $Battle_Rows['Enemy_Chakra']; $EnemyChakra= mysql_real_escape_string($EnemyChakra); $ChakraUsedE= $Genjutsu_Enemy_Rows['Chakra_Used']; $ChakraUsedE= mysql_real_escape_string($ChakraUsedE); $PastEnemyChakra="$EnemyChakra"; $EnemyDamage3= round($EnemyDamage3 / 1.25); if($EnemyDamage1==0) { $EnemyDamage3= 0; } } else { $Enemy_Move= $WeaponE; $EnemyDamage1= $Weapon_Enemy_Rows['Jutsu_Power']; $EnemyDamage1= mysql_real_escape_string($EnemyDamage1); $WeaponBE = $Battle_Rows['Enemy_Weapon_Boost']; $Weaponpower= $Battle_Rows['Enemy_Weapon_Power']; $Weaponpower = $Weaponpower + $WeaponBE; $Weaponpower= mysql_real_escape_string($Weaponpower); $EnemyPower= $Battle_Rows['Enemy_Power']; $EnemyPower= mysql_real_escape_string($EnemyPower); $EnemyDamage2= round(($Weaponpower * 10) + $EnemyDamage1 + $EnemyPower); $EnemyDamage3= round($EnemyDamage2 / 5); $HP= $Battle_Rows2['HP']; $HP= mysql_real_escape_string($HP); $Defense= $Weapon_Enemy_Rows['Defense']; $Defense= mysql_real_escape_string($Defense); $EnemyChakra= $Battle_Rows['Enemy_Chakra']; $EnemyChakra= mysql_real_escape_string($EnemyChakra); $ChakraUsedE= $Weapon_Enemy_Rows['Chakra_Used']; $ChakraUsedE= mysql_real_escape_string($ChakraUsedE); $PastEnemyChakra= $EnemyChakra; $EnemyDamage3= round($EnemyDamage3 / 1.25); } $Damage1= $Taijutsu_Rows['Jutsu_Power']; $Damage1= mysql_real_escape_string($Damage1); $Taijutsupower= $Battle_Rows2['Taijutsu_Power']; $Taijutsupower= mysql_real_escape_string($Taijutsupower); $Damage2= round(($Taijutsupower * 10) + $Damage1 + $Power); $Damage3= round($Damage2 / 5); $YourChakra= $Battle_Rows2['Chakra']; $YourChakra= mysql_real_escape_string($YourChakra); $ChakraUsed= $Taijutsu_Rows['Chakra_Used']; $ChakraUsed= mysql_real_escape_string($ChakraUsed); $Defense2= $Taijutsu_Rows['Defense']; $Defense2= mysql_real_escape_string($Defense2); $Defense1 = $Battle_Rows2['Defense']; $Defense3 = $Weapon_Rows['Defense_Boost']; $Defense1 = $Defense1 + $Defense3; $Defense1 = mysql_real_escape_string($Defense1); if($DefenseE1>0) { $Damage4 = round(($Damage3 / 100) * $DefenseE1); } $Damage3 = $Damage3 - $Damage4; if($Defense1 >0) { $EnemyDamage4 = round(($EnemyDamage3 / 100) * $Defense1); } $EnemyDamage3 = $EnemyDamage3 - $EnemyDamage4; if($Defense=="Yes") { $Damage3= 0; $DefenseMessage="It stopped you from doing damage!"; } if($Defense2=="Yes") { $EnemyDamage3= 0; $DefenseMessage2="You stopped the enemy from doing damage!"; } if($Damage1=="0") { $Damage3= 0; } if($EnemyChakra < $ChakraUsedE) { $Enemy_Move= $WeaponE; $EnemyDamage1= $Weapon_Enemy_Rows['Jutsu_Power']; $EnemyDamage1= mysql_real_escape_string($EnemyDamage1); $WeaponBE = $Battle_Rows['Enemy_Weapon_Boost']; $Weaponpower= $Battle_Rows['Enemy_Weapon_Power']; $Weaponpower = $Weaponpower + $WeaponBE; $Weaponpower= mysql_real_escape_string($Weaponpower); $EnemyPower= $Battle_Rows['Enemy_Power']; $EnemyPower= mysql_real_escape_string($EnemyPower); $EnemyDamage2= round(($Weaponpower * 10) + $EnemyDamage1 + $EnemyPower); $EnemyDamage3= round($EnemyDamage2 / 5); $HP= $Battle_Rows2['HP']; $HP= mysql_real_escape_string($HP); $Defense= $Weapon_Enemy_Rows['Defense']; $Defense= mysql_real_escape_string($Defense); $EnemyChakra= $Battle_Rows['Enemy_Chakra']; $EnemyChakra= mysql_real_escape_string($EnemyChakra); $ChakraUsedE= $Weapon_Enemy_Rows['Chakra_Used']; $ChakraUsedE= mysql_real_escape_string($ChakraUsedE); $PastEnemyChakra= $EnemyChakra; $EnemyDamage3= round($EnemyDamage3 / 1.25); } else { if($Enemy_Move=="") { $Enemy_Move= $WeaponE; $EnemyDamage1= $Weapon_Enemy_Rows['Jutsu_Power']; $EnemyDamage1= mysql_real_escape_string($EnemyDamage1); $WeaponBE = $Battle_Rows['Enemy_Weapon_Boost']; $Weaponpower= $Battle_Rows['Enemy_Weapon_Power']; $Weaponpower = $Weaponpower + $WeaponBE; $Weaponpower= mysql_real_escape_string($Weaponpower); $EnemyPower= $Battle_Rows['Enemy_Power']; $EnemyPower= mysql_real_escape_string($EnemyPower); $EnemyDamage2= round(($Weaponpower * 10) + $EnemyDamage1 + $EnemyPower); $EnemyDamage3= round($EnemyDamage2 / 5); $HP= $Battle_Rows2['HP']; $HP= mysql_real_escape_string($HP); $Defense= $Weapon_Enemy_Rows['Defense']; $Defense= mysql_real_escape_string($Defense); $EnemyChakra= $Battle_Rows['Enemy_Chakra']; $EnemyChakra= mysql_real_escape_string($EnemyChakra); $ChakraUsedE= $Weapon_Enemy_Rows['Chakra_Used']; $ChakraUsedE= mysql_real_escape_string($ChakraUsedE); $PastEnemyChakra= $EnemyChakra; $EnemyDamage3= round($EnemyDamage3 / 1.25); } $Move_Name = $Battle_Rows2['Taijutsu']; if($Move_Name=="") { $Enemy_Move="Nothing"; $EnemyChakra="$PastEnemyChakra"; $Damage3= 0; $EnemyDamage3= 0; $DefenseMessage2="This move does not exist."; } if($YourChakra < $ChakraUsed) { $Enemy_Move="Nothing"; $EnemyChakra="$PastEnemyChakra"; $Damage3= 0; $EnemyDamage3= 0; $DefenseMessage2="You do not have enough Chakra"; } else { $YourChakra= round($YourChakra - $ChakraUsed); } $DodgeRand = rand(1, 100); $DodgeRand2 = rand(1, 100); if($DodgeRand <= $DodgeE) { $DefenseMessage="Your opponent has dodged your move"; $Damage3=0; } if($DodgeRand2 <= $Dodge) { $DefenseMessage2="Your have dodged your opponents move"; $EnemyDamage3=0; } $Enemy_HP= round($Enemy_HP - $Damage3); $Enemy_MHP= $Battle_Rows['Enemy_Max_HP']; $HP= round($HP - $EnemyDamage3); if($HP < 0) { $HP= 0; } if($Enemy_HP < 0) { $Enemy_HP= 0; } $Enemy_HP= mysql_real_escape_string($Enemy_HP); $HP= mysql_real_escape_string($HP); $EnemyChakra= mysql_real_escape_string($EnemyChakra); $YourChakra= mysql_real_escape_string($YourChakra); mysql_query("UPDATE Battle_Information SET Enemy_HP='$Enemy_HP', Enemy_Chakra='$EnemyChakra' WHERE ID='$ID'"); mysql_query("UPDATE users SET HP='$HP', Chakra='$YourChakra' WHERE ID='$ID'"); $Battle_Result=mysql_query("SELECT * FROM Battle_Information WHERE ID='$ID'"); $Battle_Result2=mysql_query("SELECT * FROM users WHERE ID='$ID'"); $Battle_Rows=mysql_fetch_array($Battle_Result); $Battle_Rows2=mysql_fetch_array($Battle_Result2); $Enemy_HP999= $Battle_Rows['Enemy_HP']; $Enemy_MHP999= $Battle_Rows['Enemy_Max_HP']; $HP999= $Battle_Rows2['HP']; $MHP999= $Battle_Rows2['Max_HP']; $Enemy_Chakra999= $Battle_Rows['Enemy_Chakra']; $Enemy_MChakra999= $Battle_Rows['Enemy_Max_Chakra']; $Chakra999= $Battle_Rows2['Chakra']; $MChakra999= $Battle_Rows2['Max_Chakra']; echo " <div class='table_replace'> <div class='table_replaceb'>" . $Battle_Rows['Enemy_Name'] . " Level: " . $Battle_Rows['Enemy_Level'] . "<br /> HP: " . $Battle_Rows['Enemy_HP'] . "/" . $Battle_Rows['Enemy_Max_HP'] . " Chakra: " . $Battle_Rows['Enemy_Chakra'] . "/" . $Battle_Rows['Enemy_Max_Chakra'] . "<br />"; echo "<img src=\"/HP/HealthBar.php?C=$Enemy_HP999&M=$Enemy_MHP999\" width=\"120px\" height=\"15px\" /></img> <img src=\"/HP/ChakraBar.php?C=$Enemy_Chakra999&M=$Enemy_MChakra999\" width=\"120px\" height=\"15px\" /></img></div><br /> <div class='table_replaceb2'>Taijutsu:<br /><a href='battle.php?Type=Taijutsu'>" . $Battle_Rows2['Taijutsu'] . "</a><br /></div><div class='table_replaceb2'>Ninjutsu:<br /><a href='battle.php?Type=Ninjutsu'>" . $Battle_Rows2['Ninjutsu'] . "</a><br /></div><div class='table_replaceb2'><font size='3'>Genjutsu:<br /><a href='battle.php?Type=Genjutsu'>" . $Battle_Rows2['Genjutsu']. "</a><br /></div><div class='table_replacebattle'>Weapon:<br /><a href='battle.php?Type=Weapon'>" . $Battle_Rows2['Weapon'] . "</a><br /></div><br /><div class='table_replaceb'> " . $Battle_Rows2['Username'] . " Level: " . $Battle_Rows2['Level'] . "<br /> HP: " . $Battle_Rows2['HP'] . "/" . $Battle_Rows2['Max_HP'] . " Chakra: " . $Battle_Rows2['Chakra'] . "/" . $Battle_Rows2['Max_Chakra'] . "<br />"; echo "<img src=\"/HP/HealthBar.php?C=$HP999&M=$MHP999\" width=\"120px\" height=\"15px\" /></img> <img src=\"/HP/ChakraBar.php?C=$Chakra999&M=$MChakra999\" width=\"120px\" height=\"15px\" /></img></div>The Enemy used $Enemy_Move. $DefenseMessage<br />It did $EnemyDamage3 damage!<br />$DefenseMessage2<br />You did $Damage3 damage!"; if($Enemy_HP=="0" && $HP=="0") See, here's basically the problem, everything works fine, but if the ChakraUsedE is > Enemy_Chakra, and then uses an attack, it displays a blank page. Here's the part of the code where it happens: if($EnemyChakra < $ChakraUsedE) { $Enemy_Move= $WeaponE; $EnemyDamage1= $Weapon_Enemy_Rows['Jutsu_Power']; $EnemyDamage1= mysql_real_escape_string($EnemyDamage1); $WeaponBE = $Battle_Rows['Enemy_Weapon_Boost']; $Weaponpower= $Battle_Rows['Enemy_Weapon_Power']; $Weaponpower = $Weaponpower + $WeaponBE; $Weaponpower= mysql_real_escape_string($Weaponpower); $EnemyPower= $Battle_Rows['Enemy_Power']; $EnemyPower= mysql_real_escape_string($EnemyPower); $EnemyDamage2= round(($Weaponpower * 10) + $EnemyDamage1 + $EnemyPower); $EnemyDamage3= round($EnemyDamage2 / 5); $HP= $Battle_Rows2['HP']; $HP= mysql_real_escape_string($HP); $Defense= $Weapon_Enemy_Rows['Defense']; $Defense= mysql_real_escape_string($Defense); $EnemyChakra= $Battle_Rows['Enemy_Chakra']; $EnemyChakra= mysql_real_escape_string($EnemyChakra); $ChakraUsedE= $Weapon_Enemy_Rows['Chakra_Used']; $ChakraUsedE= mysql_real_escape_string($ChakraUsedE); $PastEnemyChakra= $EnemyChakra; $EnemyDamage3= round($EnemyDamage3 / 1.25); } Can someone help? Thanks in advanced. Quote Link to comment https://forums.phpfreaks.com/topic/167472-solved-displays-blank-d/ Share on other sites More sharing options...
asmith Posted July 26, 2009 Share Posted July 26, 2009 Ok mate, No offense to you. But you have explained your question in a very bad way. Hardly you get a response for these kind of posts. First of all you code is very long. It usually makes the peopel wanna help you so bored to go all through it. ' 2. since your code is long, At least you gotta post it fine. I copied and paste it in a file and it gave me parse error. 3. What must your code does? What is its purpose? 4. what you do that it gives you a blank screen? Quote Link to comment https://forums.phpfreaks.com/topic/167472-solved-displays-blank-d/#findComment-883079 Share on other sites More sharing options...
Xyphon Posted July 26, 2009 Author Share Posted July 26, 2009 It doesn't work because as I said OK so, here's the script(NOT the whole code, just a snipit) It doesn't really matter what the code does, because it works fine except for when it gives a blank screen. If you read the rest: See, here's basically the problem, everything works fine, but if the ChakraUsedE is > Enemy_Chakra, and then uses an attack, it displays a blank page Here's the part of the code where it happens: if($EnemyChakra < $ChakraUsedE) { $Enemy_Move= $WeaponE; $EnemyDamage1= $Weapon_Enemy_Rows['Jutsu_Power']; $EnemyDamage1= mysql_real_escape_string($EnemyDamage1); $WeaponBE = $Battle_Rows['Enemy_Weapon_Boost']; $Weaponpower= $Battle_Rows['Enemy_Weapon_Power']; $Weaponpower = $Weaponpower + $WeaponBE; $Weaponpower= mysql_real_escape_string($Weaponpower); $EnemyPower= $Battle_Rows['Enemy_Power']; $EnemyPower= mysql_real_escape_string($EnemyPower); $EnemyDamage2= round(($Weaponpower * 10) + $EnemyDamage1 + $EnemyPower); $EnemyDamage3= round($EnemyDamage2 / 5); $HP= $Battle_Rows2['HP']; $HP= mysql_real_escape_string($HP); $Defense= $Weapon_Enemy_Rows['Defense']; $Defense= mysql_real_escape_string($Defense); $EnemyChakra= $Battle_Rows['Enemy_Chakra']; $EnemyChakra= mysql_real_escape_string($EnemyChakra); $ChakraUsedE= $Weapon_Enemy_Rows['Chakra_Used']; $ChakraUsedE= mysql_real_escape_string($ChakraUsedE); $PastEnemyChakra= $EnemyChakra; $EnemyDamage3= round($EnemyDamage3 / 1.25); } To explain better, if the enemy uses a move that requires chakra, and the $ChakraUsedE var is > the $Enemy_Chakra var, this initiates: if($EnemyChakra < $ChakraUsedE) { $Enemy_Move= $WeaponE; $EnemyDamage1= $Weapon_Enemy_Rows['Jutsu_Power']; $EnemyDamage1= mysql_real_escape_string($EnemyDamage1); $WeaponBE = $Battle_Rows['Enemy_Weapon_Boost']; $Weaponpower= $Battle_Rows['Enemy_Weapon_Power']; $Weaponpower = $Weaponpower + $WeaponBE; $Weaponpower= mysql_real_escape_string($Weaponpower); $EnemyPower= $Battle_Rows['Enemy_Power']; $EnemyPower= mysql_real_escape_string($EnemyPower); $EnemyDamage2= round(($Weaponpower * 10) + $EnemyDamage1 + $EnemyPower); $EnemyDamage3= round($EnemyDamage2 / 5); $HP= $Battle_Rows2['HP']; $HP= mysql_real_escape_string($HP); $Defense= $Weapon_Enemy_Rows['Defense']; $Defense= mysql_real_escape_string($Defense); $EnemyChakra= $Battle_Rows['Enemy_Chakra']; $EnemyChakra= mysql_real_escape_string($EnemyChakra); $ChakraUsedE= $Weapon_Enemy_Rows['Chakra_Used']; $ChakraUsedE= mysql_real_escape_string($ChakraUsedE); $PastEnemyChakra= $EnemyChakra; $EnemyDamage3= round($EnemyDamage3 / 1.25); } But for some reason, if it initiates, it displays a blank screen. Quote Link to comment https://forums.phpfreaks.com/topic/167472-solved-displays-blank-d/#findComment-883083 Share on other sites More sharing options...
akitchin Posted July 26, 2009 Share Posted July 26, 2009 have you tried turning error reporting on to see what the problem is when you get a blank screen? try putting this at the top of the file: error_reporting(E_ALL); ini_set('display_errors', 'On'); what you should be looking for is a warning (not a notice). EDIT: there's a chance it could be your mysql_real_escape_string() that's causing the warning if you haven't initiated a connection to the database yet. Quote Link to comment https://forums.phpfreaks.com/topic/167472-solved-displays-blank-d/#findComment-883093 Share on other sites More sharing options...
Xyphon Posted July 26, 2009 Author Share Posted July 26, 2009 There is no warning, unfortunately. Quote Link to comment https://forums.phpfreaks.com/topic/167472-solved-displays-blank-d/#findComment-883097 Share on other sites More sharing options...
akitchin Posted July 26, 2009 Share Posted July 26, 2009 if you're getting a blank page, it is almost invariably due to a warning that halted the script before it could pass the output to the browser. are you sure you turned on error reporting at the very top of the script? Quote Link to comment https://forums.phpfreaks.com/topic/167472-solved-displays-blank-d/#findComment-883100 Share on other sites More sharing options...
Xyphon Posted July 26, 2009 Author Share Posted July 26, 2009 Positive, no warnings, all notices. And, the script works except if $Enemy_Chakra < $ChakraUsedE Quote Link to comment https://forums.phpfreaks.com/topic/167472-solved-displays-blank-d/#findComment-883104 Share on other sites More sharing options...
akitchin Posted July 26, 2009 Share Posted July 26, 2009 my mistake - may need to set display_errors this way: ini_set('display_errors', 1); give that a shot. if that doesn't work, i would suspect it's mysql_real_escape_string() causing your grief. Quote Link to comment https://forums.phpfreaks.com/topic/167472-solved-displays-blank-d/#findComment-883135 Share on other sites More sharing options...
Xyphon Posted July 26, 2009 Author Share Posted July 26, 2009 No warnings, and I don't see how mysql_real_escape_string would do it o.O.. Quote Link to comment https://forums.phpfreaks.com/topic/167472-solved-displays-blank-d/#findComment-883157 Share on other sites More sharing options...
Xyphon Posted July 26, 2009 Author Share Posted July 26, 2009 Can someone help please? Quote Link to comment https://forums.phpfreaks.com/topic/167472-solved-displays-blank-d/#findComment-883524 Share on other sites More sharing options...
akitchin Posted July 26, 2009 Share Posted July 26, 2009 from the manual for mysql_real_escape_string: "link_identifier The MySQL connection. If the link identifier is not specified, the last link opened by mysql_connect() is assumed. If no such link is found, it will try to create one as if mysql_connect() was called with no arguments. If by chance no connection is found or established, an E_WARNING level error is generated." have you opened a database connection by the time this segment runs, and if so, have you left it open or have you manually closed it with mysql_close()? Quote Link to comment https://forums.phpfreaks.com/topic/167472-solved-displays-blank-d/#findComment-883532 Share on other sites More sharing options...
Xyphon Posted July 27, 2009 Author Share Posted July 27, 2009 Well, if you look at the rest of the script, all of the moves have similar queries and whatnot, and they all work fine, but only when $EnemyChakra is less than $ChakraUsedE does it display a blank page. Quote Link to comment https://forums.phpfreaks.com/topic/167472-solved-displays-blank-d/#findComment-883595 Share on other sites More sharing options...
MadTechie Posted July 27, 2009 Share Posted July 27, 2009 The only thing in that code that would cause a fatal error is mysql_real_escape_string, so I'm going to suggest this, try this (for testing), if it still fails then its probably a fault in another section, if it works then make sure you have an open connection to the database before using mysql_real_escape_string <?php if($EnemyChakra < $ChakraUsedE) { $Enemy_Move= $WeaponE; $EnemyDamage1= $Weapon_Enemy_Rows['Jutsu_Power']; $EnemyDamage1= ($EnemyDamage1); $WeaponBE = $Battle_Rows['Enemy_Weapon_Boost']; $Weaponpower= $Battle_Rows['Enemy_Weapon_Power']; $Weaponpower = $Weaponpower + $WeaponBE; $Weaponpower= ($Weaponpower); $EnemyPower= $Battle_Rows['Enemy_Power']; $EnemyPower= ($EnemyPower); $EnemyDamage2= round(($Weaponpower * 10) + $EnemyDamage1 + $EnemyPower); $EnemyDamage3= round($EnemyDamage2 / 5); $HP= $Battle_Rows2['HP']; $HP= ($HP); $Defense= $Weapon_Enemy_Rows['Defense']; $Defense= ($Defense); $EnemyChakra= $Battle_Rows['Enemy_Chakra']; $EnemyChakra= ($EnemyChakra); $ChakraUsedE= $Weapon_Enemy_Rows['Chakra_Used']; $ChakraUsedE= ($ChakraUsedE); $PastEnemyChakra= $EnemyChakra; $EnemyDamage3= round($EnemyDamage3 / 1.25); }?> Quote Link to comment https://forums.phpfreaks.com/topic/167472-solved-displays-blank-d/#findComment-883602 Share on other sites More sharing options...
akitchin Posted July 27, 2009 Share Posted July 27, 2009 sorry - i didn't realized you'd posted the entire snippet above, as i kept referring to your second reply which had only those two small chunks repeated twice. the issue is that nothing is being echoed when the condition you've mentioned is met - all the echoing, etc. that takes place in the snippet is nested within the else {} block. track your braces and check that they are matching what they should. Quote Link to comment https://forums.phpfreaks.com/topic/167472-solved-displays-blank-d/#findComment-883608 Share on other sites More sharing options...
vineld Posted July 27, 2009 Share Posted July 27, 2009 Too late Quote Link to comment https://forums.phpfreaks.com/topic/167472-solved-displays-blank-d/#findComment-883611 Share on other sites More sharing options...
Xyphon Posted July 27, 2009 Author Share Posted July 27, 2009 Lots of thanks, fixed. Quote Link to comment https://forums.phpfreaks.com/topic/167472-solved-displays-blank-d/#findComment-883636 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.