I'm trying to use a drop down form box & select statements to gather certain pieces of information from my database however i'm recieving the error
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /study/comp/c3329871/webpages/mysql/queryContinent.php on line 26
This is the code from my php file
<?php
//Include the connection details, open $connection and select database
include ("./php/connection.php");
//Get the Initial Letter passed
$dispContinent = $_GET["selContinent"];
//If the variable $dispContinent is NOT EQUAL to ALL
if ($dispContinent != "All" )
{
$query = $query." 'SELECT * FROM `symbols` WHERE continent ='$dispContinent'";
}
Echo $query;
// create query using the initial letter from above and a % wildcard
$query = "'SELECT * FROM 'symbols' WHERE 'continent' = '$dispContinent' ";
// execute query
$result = mysql_query($query);
print "<table border=1>";
while($row = mysql_fetch_array($result)) {
print "<tr>";
print "<td>".$row['id']."</td>";
print "<td>".$row['country']."</td>";
print "<td>".$row['animal']."</td>";
print "<td>".$row['continent']."/td>";
print "</tr>";
}
print "</table>";
?>
and here is the HTML form (I know it's not correct and won't validate but i'll fix that later on)
<body>
<form name="selContinent" id="selContinent" method="get" action="queryContinent.php">
<select name="selContinent" form="selContinent">
<option value="All">All</option>
<option value="North America">North America</option>
<option value="Asia">Asia</option>
<option value="Australia">Australia</option>
<option value="Europe">Europe</option>
</select>
<input type="submit">
</form>
</body>
Any ideas on how to fix this error?