I am very New to writing queries. I have a query that I cant figure out. Can anyone give any suggestions.

$sql="SELECT Master.nameFirst, Master.nameLast, Sum(Batting.HR) AS HR, Sum(Batting.RBI) AS RBI
FROM Batting INNER JOIN Master ON Batting.playerID = Master.playerID
GROUP BY Master.nameLast, Master.nameFirst, Batting.playerID
WHERE (HR >=500)
ORDER BY Batting.HR DESC";

I am getting 2 fields out of Master and 2 out of Batting. I am getting a sum of the batting HR and the Batting RBI. I want the records returned for anyone over 500 homeruns in desc order.

Here is my error
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/httpd/vhosts/pitcherspalace.com/httpdocs/baseballdisplay.php on line 209
Sorry, we have no records

What am i doing wrong.

Michael
pitchdoctor@pitcherspalace.com