I began building a CMS for a blog today, and have had trouble getting the two entries I manually inserted via phpMyAdmin to show up on the page. It might be an issue with the database, might be an issue with the code, but for some reason the MySQL table iterates through only once with blank entries. Here is the PHP:
$link = mysql_connect('localhost', 'root','');
if (!$link)
die('<h3>Cound not connect to MySQL<h3><p><div>'.mysql_error()."</p></div>");
mysql_select_db('blog_cms', $link);
$posts = mysql_query("SELECT * FROM entries");
if ($posts == null) die ("<h3>No blog posts found!</h3><div><p>Something went wrong.</p></div>");
else
while ($entry = mysql_fetch_row($posts)); {
echo "<h3>".$entry[0]."</h3>";
echo "<div>";
echo "<p>".$entry[1]."</p>";
echo "</div>";
}
And for the output HTML I am simply getting
<h3></h3><div><p></p></div>
Screenshot of phpMyAdmin
Why is this only returning a single blank row?