Jump to content

weird


Danny620

Recommended Posts

this is my code and when i run it i get

 

echo "
<tr>
    <td width=\"279\"><div align=\"center\">$battle[username]</div></td>
    <td width=\"206\"><div align=\"center\">if($battle[clan] == 'false'){ echo 'Not In One';}else{ echo $battle[clan]; }</div></td>
    <td width=\"55\"><div align=\"center\">
   <a href=\"profile.php?profile=".$battle[username]."\">attack</a></div></td>
    <td width=\"68\"><div align=\"center\">$battle[wins]</div></td>
    <td width=\"68\"><div align=\"center\">$battle[lose]</div></td>
</tr>
  ";

 

this

 

Username

 

Alliance

 

Attack

 

Wins

 

Loses

       

josh

 

if(false == 'false'){ echo 'Not In One';}else{ echo false; }

 

attack

 

25

 

0

jess

 

if(rush == 'false'){ echo 'Not In One';}else{ echo rush; }

 

attack

 

0

 

2

Daniel

 

if(rush == 'false'){ echo 'Not In One';}else{ echo rush; }

 

attack

 

0

 

1

Dannyada

 

if(rush == 'false'){ echo 'Not In One';}else{ echo rush; }

 

attack

 

0

 

0

deaef

 

if(rush == 'false'){ echo 'Not In One';}else{ echo rush; }

 

attack

 

0

 

0

Link to comment
https://forums.phpfreaks.com/topic/171543-weird/
Share on other sites

That is because you are echoing the whole text use this:

echo "
<tr>
    <td width=\"279\"><div align=\"center\">".$battle[username]."</div></td>
    <td width=\"206\"><div align=\"center\">";
if($battle[clan] == 'false'){ 
echo 'Not In One';
}
else{ 
echo $battle[clan]; 
}
echo"</div></td>
    <td width=\"55\"><div align=\"center\">
   <a href=\"profile.php?profile=".$battle[username]."\">attack</a></div></td>
    <td width=\"68\"><div align=\"center\">".$battle[wins]."</div></td>
    <td width=\"68\"><div align=\"center\">".$battle[lose]."</div></td>
</tr>
  ";

That should work :)

Link to comment
https://forums.phpfreaks.com/topic/171543-weird/#findComment-904635
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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