why would this code function the way I want but say the $status is undefined?PHP Code:$res = mysql_query("SELECT * FROM members where username = '$user'");
while ($row=mysql_fetch_array($res)) {
$status = $row['status'];
if ($status == 1) {
echo "<div align='left'>You are a site admin.</div>";
$res = mysql_query("SELECT * FROM pcourse");
$num_rows = mysql_num_rows($res); {
if ($num_rows == 1)
echo "There is $num_rows pending course. <a href='pending.php'>View</a>";
elseif ($num_rows == 0)
echo "There are $num_rows courses pending. <a href='pending.php'>View</a>";
elseif ($num_rows > 1)
echo "There are $num_rows pending courses. <a href='pending.php'>View</a>"; }}};



Reply With Quote

Bookmarks