Re: Having problems with a query..

2001-05-30 Thread Kent Hoover
LEFT JOIN should do the trick for you... SELECT players.PLAYERID, players.FIRSTNAME, players.LASTNAME, COUNT(goals.SCORER) FROM players LEFT JOIN goals ON goals.SCORER = players.PLAYERID WHEREplayers.TEAMID = '$TEAMID' GROUP BY PLAYERID ORDER BY player.LASTNAME; Cheers,

Having problems with a query..

2001-05-28 Thread Chad Day
$newgoalquery = mysql_query(select players.PLAYERID, players.FIRSTNAME, players.LASTNAME, COUNT(goals.SCORER) as TG FROM players, goals where (goals.SCORER = players.PLAYERID) AND players.TEAMID = '$TEAMID' GROUP BY PLAYERID ORDER BY players.LASTNAME); I'm trying to fetch out the number of goals