Data not entering the table
- by Luke
//loop through usernames to add to league table
for ($i = 0; $i < count($user); $i++)
{
//set some new variables in an array
$username = $user[$i];
$squad = $team[$i];
//add details to league table
if ( $username != "Ghost")
{
$database->addUsersToLeagueTable($username, $squad);
}
}
I use this code to add to the league table, the following is more code:
function addUsersToLeagueTable($username, $squad)
{
$q = "INSERT INTO `$_SESSION[comp_name]` ( `user` , `team` , `home_games_played` , `home_wins` , `home_draws` , `home_losses` ,`home_points, `home_goals_for` , `home_goals_against` , `away_games_played` , `away_wins` , `away_draws` , `away_losses` , `away_points` , `away_goals_for` , `away_goals_against` )
VALUES (
'$username', '$squad', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0')";
return mysql_query($q, $this->connection);
}
Can you see any obvious reason why this isn't happening?
Thanks