Jump to content

Pokemon team help.


Ratee

Recommended Posts

i need help i have this script....   

 

 


<?php 
// Connects to your Database 
include ('db.php');
$sql = "SELECT * FROM pokemon WHERE owner_id=$id and slot=1";
$sql2 = mysql_query($sql);
$rows = mysql_fetch_array($sql2);
$grab = mysql_fetch_array(mysql_query("SELECT * FROM types WHERE id = {$rows['type']}"));
$typename = $grab['name'];
$fetchthis = mysql_fetch_array(mysql_query("SELECT * FROM pokedex WHERE id = {$rows['pokedex_id']}"));
$pokedexname = $fetchthis['name'];
?>





    <?php
if($typename== Normal)
{
echo "";
}
else
{
echo $typename;
}

echo $pokedexname;

?></b>
<?php 
echo "<img src=images/Pokemon/";
echo $typename;
echo "/";
echo $pokedexname;
echo ".png";
echo ">"; ?>


 

 

but if the user has no pokemon i want it to say empty slot, but not to sure how to do it, could anyone help me please?

Link to comment
Share on other sites

does this help at all?


<?php 
// Connects to your Database 
include ('db.php');
//First Query
$Sql = "SELECT * FROM `pokemon` WHERE `owner_id` = '{$id}' and `slot` = '1'";
$Query = mysql_query($Sql);
$Rows = mysql_fetch_array($Query);
//Second Query
$Sql2 = "SELECT * FROM `pokemon` WHERE `owner_id` = '{$id}' and `slot` = '1'";
$Query2 = mysql_query($Sql2);
$Grab = mysql_fetch_array($Query2);
//Third Query
$Sql3 = "SELECT * FROM `pokedex` WHERE `id` = '{$rows['pokedex_id']}'";
$Query3 = mysql_query($Sql3);
$FetchThis = mysql_fetch_array($Query3);
//Num Of Pokemon Per User
$NumOfPokemon = mysql_num_rows($Query2);
//check number
if ($NumOfPokemon == 0) {
echo "No pokemon!";
} else {
if ($Grab['name'] != "Normal") {
	echo "{$Grab['name']}";
}
echo "{$FetchThis['name']}";
echo "<img src=images/Pokemon/";
echo $Grab['name'];
echo "/";
echo $FetchThis['name'];
echo ".png";
echo ">";
}









    <?php
if($typename== Normal)
{
echo "";
}
else
{
echo $typename;
}

echo $pokedexname;

?></b>
<?php 
?>

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.