I keep getting the following error:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource on line 17.
I'm trying to figure out if there's some problem with my SQL query statement, or what. When I try to print $result, nothing is displayed.
I've included my code below. Any help would be greatly appreciated. Thanks!
<?php
require("include/db_functions.inc.php");
get_db();
beginSession();
include 'template/header.php';
echo '<h2>Member List</h2>';
$sql = "SELECT MemberName, FirstName, LastName, Website, Location, Timezone, Bio FROM t_Members, t_MemberBio WHERE t_Members.MemberName=t_MemberBio.MemberName ORDER BY MemberName ASC";
$result = mysql_query($sql, $con); echo '999999999'.$result;
$numEntries = 0;
// Print member list
echo "<ul class=\"memberlist\">";
while ($row = mysql_fetch_array($result)) {
$numEntries += 1;
echo "<li>$row[MemberName]";
echo '<ul>';
echo "<li>$row[FirstName] $row[LastName]</li>";
echo "<li>$row[Website]</li>";
echo "<li>$row[Location]</li>";
echo "<li>$row[Timezone]</li>";
echo "<li>$row[Bio]</li>";
echo '</ul>';
echo '</li>';
}
echo '</ul>';
if ($numEntries == 0)
echo '<p><i>There are no members</i></p>';
mysql_close($con);
?>
<p>Blog Links
<br />
<a href="show.php">See Blog</a>
<br/>
<a href="write_entry.php">Write Blog Entry</a></p>
<?php include 'template/footer.php'; ?>