[PHP/SQL]
I've been making some modifications so characters.php would give a nicier design to the information of each character. But now I need help on something and hope someone here could help me.
I just need a code to be added so when the player does not have a guild it shows: "The player doesn't have a guild" instead of just blank space where it should be.
The code that writes the name of the guild is:
----
if ($player->isAttr('guild_name')){
echo '<b>*Guild:</b> '.$player->getAttr('guild_rank').' of <a href="guilds.php?guild_id='.$player->getAttr('guild_id').'">'.htmlspecialchars($player->getAttr('guild_name')).'</a>'."\n";
}
----
I don't know how to put an ELSE that works with it, to give the result I want.
Can someone help me?
thanks =)
I've been making some modifications so characters.php would give a nicier design to the information of each character. But now I need help on something and hope someone here could help me.
I just need a code to be added so when the player does not have a guild it shows: "The player doesn't have a guild" instead of just blank space where it should be.
The code that writes the name of the guild is:
----
if ($player->isAttr('guild_name')){
echo '<b>*Guild:</b> '.$player->getAttr('guild_rank').' of <a href="guilds.php?guild_id='.$player->getAttr('guild_id').'">'.htmlspecialchars($player->getAttr('guild_name')).'</a>'."\n";
}
----
I don't know how to put an ELSE that works with it, to give the result I want.
Can someone help me?
thanks =)
Last edited: