使用mysql的垂直菜单不会显示数据

I am by no means an exoert I am just trying to get my head round php and mysql to create a blog for our animal rescue centre. I am trying to create a verticle menu using a 'title' and 'link' field stored in a mysql database. I came across this site whilst searching for help with another problem and have ended up on here for help on a lot of things. This is the first time I have posted though so I apologize if I have done it in the wrong place or anything. The code i have at the moment after a day and a half messing with it and reading tutorials.

<?php include 'database-connection.php' ?>
<div id="left">
<div class="left-menu">
<h3>Blog Posts</h3>
<ul>
<?php
$query = mysql_query("SELECT * FROM animalrescuediary WHERE type = 'Blog-Posts' ")
or die(mysql_error()); 
WHILE($rows = mysql_fetch_array($query));
echo "<li><a href='";
echo $rows['link'];
echo "'>";
echo $rows['title'];
echo "</a></li>";
?>
</ul>
</div><!-- left-menu -->
</div><!-- left -->

This is not chucking out any error text but it is not dispaying the menu. It's the lack of error codes that has made it hard to search for an answer. Thank you in advance for any help with this.

there is no statement block for your while. you cut it with the ";" at the end. try this:

while($rows = mysql_fetch_array($query))
{
    echo "<li><a href='";
    echo $rows['link'];
    echo "'>";
    echo $rows['title'];
    echo "</a></li>";
}
?>
</ul>
</div><!-- left-menu -->
</div><!-- left -->

May be...

while ($rows = mysql_fetch_array($query)) {
  echo "<li><a href='";
  echo $rows['link'];
  echo "'>";
  echo $rows['title'];
  echo "</a></li>";
}

The while sentence lacks brackets. They enclose the code that will be iterated.

So, it should be:

while($rows = mysql_fetch_array($query))
{
    echo "<li><a href='";
    echo $rows['link'];
    echo "'>";
    echo $rows['title'];
    echo "</a></li>";
}
?>