Hey guys I am trying to get some results from my DB and display them in a table. When I look at it, it shows up blank (nothing in the source code either). If I take it out of the while loop and call it through an array I can get the single results. Here is my code.
<?php
session_start();
if($_SESSION['trackerIn'] != 'yes')
{
header("Location: trackerlog.php");
}
?>
<html>
<head>
<title>Untitled Document</title>
</head>
<body>
<?php
$con = mysql_connect("localhost","username","password");
if (!$con) {
echo "unable to connect to DB";
echo mysql_error($con);
exit();
}
$db = mysql_select_db("datron");
if (!$db) {
echo "unable to open DB";
echo mysql_error($db);
exit();
}
$havelogged = "SELECT username FROM users where loggedin = 'yes';";
$loggedrs = mysql_query($havelogged);
echo "<table>";
while ($loggedrow = mysql_fetch_array($loggedrs))
{
echo "<tr><td>$loggedrow['username']</td><td>$loggedrow['loggedin']</td></tr>";
}
echo "</table>";
?>
</body>
</html>