服务器错误 - HTTP 500(内部服务器错误)仅在访问此PHP页面时

I am a beginner at PHP, I have made a few pages which insert into my MySQL DB, as well as retrieve. This one page always gives me the 500 error, but my other PHP pages dont (Such as the INSERT record). Running PHP 5.2, apache 2.2

<?php
$con = mysql_connect("localhost", "XXXX", "XXXX");
if (!$con) 
{
 die('Could not connect: ' . mysql_error());
 }
  mysql_select_db("equipment", $con);

$result = mysql_query("SELECT * FROM equipmentwanted");

while $row = mysql_fetch_array($result))
    {
echo $row['fname'] . " " . $row['lname'];
echo "<br />";
    }

mysql_close($con);

?>

Some things to look at:

1) Not checking for query failures:

$result = mysql_query("SELECT * FROM equipmentwanted") or die(mysql_error());
                                                      ^^^^^^^^^^^^^^^^^^^^^^
  mysql_select_db("equipment", $con) or die(mysql_error());
                                    ^^^^^^^^^^^^^^^^^^^^^^

2) Syntax error:

while $row = mysql_fetch_array($result))
      ^--- missing a (