The default value for the avatar field of my database is 0. If the value is 0 I want text to be outputted on the page reading 'No Avatar'. If there is something else e.g. an URL, I want this to be printed as an image on the page.
Here is what I've got:
<?php
if ($player->avatar == 0)
{
echo "No avatar";
}
else
{
print "" . $player->avatar . "";
}
?>
I think it is displaying 'No avatar' even if the value isn't 0...! I think I may need to call the avatar field from the players part of the database however I'm not sure how to do that correctly.
Someone please please help! I've had no luck with this one for a week!
(I've attached the full PHP page as .txt file as well as a couple of screen caps, I'm afraid the site is not live at this stage)