I’m trying to insert all the values of the array into the database. Every time I try it I don’t get any errors but the information is never entered into MySQL.
<?
//connect to mySQL
$db = mysql_connect("localhost");
//connect to the database test
$doh = mysql_select_db('madden_league');
//array of teams
$team[0] = "Eagles";
$team[1] = "Giants";
$team[2] = "Rams";
$team[3] = "Titans";
$team[4] = "49ers";
$team[5] = "Browns";
$team[6] = "Packers";
$team[7] = "Bears";
//insert array values 0-7 into database
for($test = 0; $test <= 7; $test++)
{
$sql = mysql_query("INSERT INTO 'schedule'
(home)
VALUES
($team[$test])");
$result = mysql_query($sql);
}
?>