Jump to content

[SOLVED] Why does it change the name to 0? Please help.


Shiny_Charizard

Recommended Posts

<?PHP
include('connect.php');
session_start();

//variables
$submit = $_POST["submit"];
$slot1_2= mysql_query("SELECT * FROM pokemon WHERE username='$username' AND slot='1'");
$slot1= mysql_fetch_array($slot1_2);



if(isset($submit))
{   
//If evolving Chimchar
if($slot1[pkmn_name] == "Chimchar" && $slot1[pkmn_level] == "36")
{
	 mysql_query("UPDATE pokemon SET pkmn_name='Monferno' AND pkmn_sprite='http://tpfrpg.ghostblade.us/images/pokemon/Monferno.png' AND pkmn_icon='http://tpfrpg.ghostblade.us/images/pokemon/icons/monferno.png' WHERE pokemon_id='$slot1[pokemon_id]'");
echo "<center>Congratulations! Your <b>Chimchar</b> evolved into a <b>Monferno</b>!</center>";
}	
//If evolving Monferno
elseif($slot1[pkmn_name] == "Monferno" && $slot1[pkmn_level] == "56")
{
	 mysql_query("UPDATE pokemon SET pkmn_name='Infernape' AND pkmn_sprite='http://tpfrpg.ghostblade.us/images/pokemon/Infernape.png' AND pkmn_icon='http://tpfrpg.ghostblade.us/images/pokemon/icons/infernape.png' WHERE pokemon_id='$slot1[pokemon_id]'");
echo "<center>Congratulations! Your <b>Monferno</b> evolved into an <b>Infernape</b>!</center>";
}		
//If evolving Charmander
elseif($slot1[pkmn_name] == "Charmander" && $slot1[pkmn_level] == "36")
{
	 mysql_query("UPDATE pokemon SET pkmn_name='Charmeleon' AND pkmn_sprite='http://tpfrpg.ghostblade.us/images/pokemon/Charmeleon.png' AND pkmn_icon='http://tpfrpg.ghostblade.us/images/pokemon/icons/charmeleon.png' WHERE pokemon_id='$slot1[pokemon_id]'");
	 echo "<center>Congratulations! Your <b>Charmander</b> evolved into a <b>Charmeleon</b>!</center>";
}	    
//If evolving Charmeleon
elseif($slot1[pkmn_name] == "Charmeleon" && $slot1[pkmn_level] == "56")
{
	 mysql_query("UPDATE pokemon SET pkmn_name='Charizard' AND pkmn_sprite='http://tpfrpg.ghostblade.us/images/pokemon/Charizard.png' AND pkmn_icon='http://tpfrpg.ghostblade.us/images/pokemon/icons/charizard.png' WHERE pokemon_id='$slot1[pokemon_id]'");
	 echo "<center>Congratulations! Your <b>Charmeleon</b> evolved into a <b>Charizard</b>!</center>";
}
else
{
 echo "<center>Your $slot1[pkmn_name] can't evolve.</center>";
}	 
}
echo"<br />
<br />
<br />
<form action='evolve.php' method='POST'>
<center>
Do you want to evolve your $slot1[pkmn_name]?	
<br />
<IMG SRC='$slot1[pkmn_sprite]'>
<br />
<input type='submit' name='submit' value='Evolve'>
</center>
</form>";
?>

 

 

Why does it change the "pkmn_name" MySQL row to 0 instead of the name specified in the code and it doesn't even update the MySQL rows "pkmn_sprite" & "pkmn_icon".

Why?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.