从MySQL获取数组时出错[重复]

Possible Duplicate:
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in

On my detailed view page, and grabs the correct ID in the URL bar, like so:

http://localhost/attractions/details.php?ID=1

My page title and sidebar load, but in the space where I want my details of the record, I get this error message:

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /Applications/XAMPP/xamppfiles/htdocs/attractions/details.php on line 41

This is the 'details.php' page code (with the unnecessary html removed):

<?php
include 'page-start.php';
$myQuery  = "SELECT Attraction.*, Type.TypeName ";
$myQuery .= "FROM Attraction ";
$myQuery .= "INNER JOIN Type ON Attraction.Type = Type.TypeID";
$myQuery .= "WHERE AttractionID=" . $_GET['ID'];
$result = mysql_query($myQuery);
if (!result) {
    die('Query error: ' . mysql_error());
} 
?>

<body>
<div class="container">
        <h2>List of Attractions</h2>

        <?php
            //display attractions row by row
            while($row = mysql_fetch_array($result))
            {
                echo '<div class="attraction">';
                echo '<h4><a href="details.php?ID=' . $row['AttractionID'] . '">' . $row['Name'] . '</a></h4>';
                echo '<div class="featureimage">';
                echo '<img src="'. $row['ImageUrl'] . '" />';
                echo '</div>';
                echo '<p>' . $row['TypeName'] . '</p>';
                echo '<h5>' . $row['Summary'] . '</h5>';
                echo '</div>';  
            }
        ?>
</div><!-- container -->
</body>
</html>
<?php
include 'page-end.php';
?>

Line 41 is this line:

while($row = mysql_fetch_array($result))

I just know I will be overlooking something so simple here, but I'm stumped and I really cannot figure out what's causing the error, please can some one shine a little light on my situation, I've searched SO for similar questions, but there were none that could help me!

your missing backticks as required in MySQL, for the Join code, when your using table names that are keywords E.G Type | TYPE | TyPE...

$myQuery  = "SELECT `Attraction`.*, `Type`.`TypeName` ";
$myQuery .= "FROM `Attraction` ";
$myQuery .= "INNER JOIN `Type` ON `Attraction`.`Type` = `Type`.`TypeID`";
$myQuery .= "WHERE `AttractionID` =" . $_GET['ID'];

and as Jeffrey said it will return false if the query was invalid

Notice that mysql_query() may return boolean values. You need to check whatever mysql_query() worked or not (if not it returns false) before using its results as result type.

In your case the query obviously failed and returned false that can't be used as resource. You should go with

if (!$result) { /* we have a database error */ }

Look at this part: if (!result) { your missing the $. That should generate an error by itself, maybe you are not showing notices. Anyway, your SQL is returning false, but you're not catching that because of the error I mentioned. So fix that error and check your SQL.

The likely explanation if that your mysql_query is simply failing, giving your variable $result a value of FALSE (which is a boolean) and then mysql_fetch_array() is choking on that BOOLEAN. Verify that your query works. You're not triggering your Query Error condition because you're missing the $ on if (!result) {

Also, best practice it to use PDO or MYSQLI rather than mysql_ functions. (They're (going to be--thanks Martin) deprecated.)