if commands with $row
Posted: Tue Jan 16, 2007 11:57 am
If this isnt supposed to be here im sorry, it has php and database.
I have this code, where it searches to see if the guild = the guild set in the user database. If it does, it checks the rank in the user database for that guild, so if the rank=leader, theyre leader of the guild. Right now i have the character set to recruiter, and it doesnt show up the add member section its supposed to, and im not seeing why. Ive tried not using variables and just putting the raw and it hasent worked either. Heres my code to see.
I have this code, where it searches to see if the guild = the guild set in the user database. If it does, it checks the rank in the user database for that guild, so if the rank=leader, theyre leader of the guild. Right now i have the character set to recruiter, and it doesnt show up the add member section its supposed to, and im not seeing why. Ive tried not using variables and just putting the raw
Code: Select all
if ($row['Rank'] == Recruiter)Code: Select all
if($_SESSION['Uname'] == "")
{
echo error();
}
else
{
$result = mysql_query("SELECT * FROM `loginphp` WHERE `Guild` = '{$_SESSION['Guild']}'") or die(mysql_error());
$row = mysql_fetch_array( $result ); //set $row to result
$_Rank = str_replace("<", "", $row['Rank']);
if($row['Guild'] == $_SESSION['Guild'])
{
$Leader = "Leader";
$Admin = "Admin";
$Recru = "Recruiter";
echo "<center><font color=000000 span class='style3'><b>Welcome to " . $_SESSION['Guild'] . " " . $_SESSION['Uname'] . "!</b>
<br>Rank: " . $_Rank . "<br></font>";
echo "<font color=000000 span class='style3'><a href=guildcp.php?action=members>Members</a> ";
if($row['Rank'] == $Leader)
{
echo "<font color=000000 span class='style3'><a href=guildcp.php?action=editinfo>Edit Guild Info</a><br>";
}
if($row['Rank'] == $Admin || $row['Rank'] == $Leader)
{
echo "<font color=000000 span class='style3'><a href=guildcp.php?action=editmember>Edit Members</a> ";
}
if($row['Rank'] == $Recru)
{
echo "<font color=000000 span class='style3'><a href=guildcp.php?action=add>Add Member</a><br>";
}
}
else
{
echo member();
}
}
function error()
{
echo "<font color=000000 span class='style3'><b>You must login to use this feature!</b>";
}
function member()
{
echo "<font color=000000 span class='style3'><b>You must create a guild first or be a member!</b>";
}