You can have a table like this.
[SQL]
CREATE TABLE `games` (
`gameid` int(10) NOT NULL auto_increment,
`week` mediumint(5) NOT NULL default '0',
`hometeam` varchar(255) NOT NULL default '',
`visitingteam` varchar(255) NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=0 ;[/SQL]
Then a table like this.
[SQL]
CREATE TABLE `confidence_choices` (
`gameid` int(10) NOT NULL auto_increment,
`userid` int(10) NOT NULL default '0',
`week` mediumint(5) NOT NULL default '0',
`confidence_points` mediumint(2) NOT NULL defaut '0'
)ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=0;
[/SQL]
Then when they send in their confidence points, you just run a query like this.
PHP Code:
$check_confidence = $db->query_first("SELECT COUNT(gameid) AS 'count' FROM confidence_choices WHERE week = $week AND confidence_points = $confidece_point");
if($check_confidence['count'] == 0)
{
//User hasn't submit value
}
else
{
//User has submit value, show error message
}