What's this line all about, what does all this mean , resultgroup g where r.group_id = g.group_id
$result = mysql_query ("SELECT * from result r, resultgroup g where r.group_id = g.group_id and r.comp_id = $comp_id and g.regular_yesno = '0' and r.game_played = '1'");
this is the sql table for 'results'
result_id int(10) NOT NULL auto_increment,
group_id int(10) NOT NULL default '0',
comp_id int(10) NOT NULL default '0',
team1_id int(10) NOT NULL default '0',
team2_id int(10) NOT NULL default '0',
game_played int(2) NOT NULL default '0',
team1_score int(10) default NULL,
team2_score int(10) default NULL,
list_order int(10) default NULL,
weekday char(3) default NULL,