i really can't figure this out, please help.
here is the error i'm getting:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/active79/public_html/view.php on line 23
here is the code (line 23 being the one with the mysql_fetch_array):
if (isset($GET['location'])) {
$query = "SELECT * FROM users WHERE city = {$GET['location']}";
$result = mysql_query ($query);
} else {
echo 'You didn\'t enter a location.';
}
echo '<table border="0" width="90%" cellspacing="3" cellpadding="3" align="center">
<tr>
<td align="left" width="20%">Location</td>
</tr>';
while ($row = mysql_fetch_array ($result, MYSQL_ASSOC)) {
echo " <tr>
<td align=\"left\">{$row['city']}</td>
</tr>\n";
}
echo '</table>';
mysql_close();