Data not entering the table
Posted
by Luke
on Stack Overflow
See other posts from Stack Overflow
or by Luke
Published on 2010-05-01T23:31:37Z
Indexed on
2010/05/01
23:37 UTC
Read the original article
Hit count: 179
//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
© Stack Overflow or respective owner