My if statement does not seem to be working.
http://pastebin.com/498TNs7v
anyone see a problem? its just printing all items not just xbox ones.
If statement
Moderator: General Moderators
- greyhoundcode
- Forum Regular
- Posts: 613
- Joined: Mon Feb 11, 2008 4:22 am
Re: If statement
1. It isn't possible to tell what is happening within the $game->GetConsole() method from your Paste Bin code alone.pastebin.com wrote:Code: Select all
<?php if ( $game->getConsole() == "xbox" ) ?> { <tr> <td > <?php echo "<img src=".$game->getImg().">"; ?> </td> <td> <a href="desc.php?id=<?php echo $game->getID(); ?> &name=<?php echo $game->getName(); ?>"><?php echo $game->getName();?></a> </td> <td> <?php echo $game->getDate(); ?> </td> <td> <?php echo $game->getPrice(); ?> </td> <td> <a href="cart.php?id=<?php echo $game->getID(); ?>">Add to cart</a> </td> </tr> }
2. Following your If statement in the above extract you have a curly brace, however it is not within PHP tags <?php ?>.