jsquadrilla
11-17-2011, 01:49 PM
Hello,
I currently have an array, which each element contains a string similiar to
1,Chicago,CEN,19,12,4,3,27,10,67,53,+14,7-1-2,5-3-1,2-2,7-2-1,Won 4
2,Pittsburgh,ATL,18,11,4,3,25,8,57,43,+14,6-1-1,5-3-2,3-2,7-2-1,Won 1
// 28 more lines like this, each in an array element
I also have an array containing the MySQL table headers that I want to input those values to:
$tableHeaders = array("Rank", "Team", "Division", "Games Played", "Wins", "Losses", "Overtime Losses", "Points", "Regulation Plus Overtime Wins", "Goals For", "Goals Against", "Goal Differential", "Home Record", "Away Record", "Shootout", "Last 10", "Streak");
I tried doing the INSERT statement as I would normally do, but I don't think it's working for these arrays.
I think it's a foreach statement that I have to do, but I can't find a good example. Can anyone point me in the right direction?
I currently have an array, which each element contains a string similiar to
1,Chicago,CEN,19,12,4,3,27,10,67,53,+14,7-1-2,5-3-1,2-2,7-2-1,Won 4
2,Pittsburgh,ATL,18,11,4,3,25,8,57,43,+14,6-1-1,5-3-2,3-2,7-2-1,Won 1
// 28 more lines like this, each in an array element
I also have an array containing the MySQL table headers that I want to input those values to:
$tableHeaders = array("Rank", "Team", "Division", "Games Played", "Wins", "Losses", "Overtime Losses", "Points", "Regulation Plus Overtime Wins", "Goals For", "Goals Against", "Goal Differential", "Home Record", "Away Record", "Shootout", "Last 10", "Streak");
I tried doing the INSERT statement as I would normally do, but I don't think it's working for these arrays.
I think it's a foreach statement that I have to do, but I can't find a good example. Can anyone point me in the right direction?