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!