Im trying to figure out how to choose a specific year in my select statement. I am setting the year value with $year. I cant use "where" at the end of the statement du e to the "group by" being used. The column Im wanting to use is classic_year. Heres my current statement which works fine if I dont want to choose a year.
$query = mysql_query("SELECT t.team_id, t.classic_year, t.div_champs,
t.partner1_firstname, t.partner1_lastname,
t.partner2_firstname, t.partner2_lastname,
r.cday1_numfish AS numfish1,
r.cday2_numfish AS numfish2,
r.cday1_netwgt AS netwgt1,
r.cday2_netwgt AS netwgt2,
MAX(r.cday1_bigfish) AS bigfish1,
MAX(r.cday2_bigfish) AS bigfish2,
(r.cday1_netwgt) + (r.cday2_netwgt) AS twgt
FROM ".$prefix."_classic_teams t
LEFT JOIN ".$prefix."_classic_results r ON r.team_id=t.team_id
GROUP BY t.team_id
ORDER BY twgt DESC");
Any help would be appreciated.