masterofollies
08-01-2008, 03:35 AM
So I am trying to get a while loop to display all staff members on a script. Administrators are level 1, and Secondary staff is level 3. That's the only two I want to include. Now if I set it for level 1 staff, it works. Or if I set it for level 3 staff, it works. but the AND will not work, nothing will be displayed that way. I don't understand...
$staffquery = doquery("SELECT user,stafflevel FROM {{table}} WHERE stafflevel='1' AND stafflevel='3' ORDER BY stafflevel", "users");
while ($staffrow = mysql_fetch_array($staffquery)) {
if ($staffrow["stafflevel"] == 1) { $person = "<font color=red><b>Administrator</b></font>"; }
elseif ($staffrow["stafflevel"] == 3) { $person = "<font color=green><b>Help Aid</b></font>"; }
$page .= "<tr><td>".$staffrow["user"]."</td><td>$person</td></tr>";
}
$staffquery = doquery("SELECT user,stafflevel FROM {{table}} WHERE stafflevel='1' AND stafflevel='3' ORDER BY stafflevel", "users");
while ($staffrow = mysql_fetch_array($staffquery)) {
if ($staffrow["stafflevel"] == 1) { $person = "<font color=red><b>Administrator</b></font>"; }
elseif ($staffrow["stafflevel"] == 3) { $person = "<font color=green><b>Help Aid</b></font>"; }
$page .= "<tr><td>".$staffrow["user"]."</td><td>$person</td></tr>";
}