I am trying to use the query:
'SELECT Players.Name, Average FROM Players,Teams WHERE Average > .300 AND Players.Team=Teams.Team AND Teams.Name IN ('Indians', 'Yankees');
within my php file that I created which is:
<html>
<body>
<?PHP
$db = mysql_connect("xfdfa","sfasfa","xffx");
mysql_select_db("adfdfa",$db);
$result = mysql_query("'SELECT players.Name, Average FROM players,teams WHERE Average > .300 AND players.Team=teams.$
if ($myrow = mysql_fetch_array($result))
{
echo "<table border=1>\n";
echo "<tr><td>Name</td><td>Average</td></tr>\n";
do {
printf("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>\n", $myrow[ID],
$myrow[Name], $myrow[Average]);
}
while ($myrow = mysql_fetch_array($result));
echo "</table>\n";
}
else {
echo "Sorry, no records were found!";
}
?>
</body>
</html>
and I keep receiving the following error:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /afs/umbc.edu/users/a/n/andrade1/pub/www/is448/project6-1/baseball.php on line 7
Sorry, no records were found!