Ok if anyone can help i got another problem.
$content=file("$form_data1");
print_r($content);
$team1=$content[1];
unset($content[1]);
$tabbed=implode("",preg_replace('%[ ]{2,}%s', "\t", $content));
preg_match_all("%(.*)\t(.*)\t(.*)\t(.*)\t(.*)\t(.*)\t(.*)\t(.*)\t(.*)\t(.*)\t(.*)\t(.*)\t(.*)\t(.*)\t(.*)\t(.*)\t(.*)\t(.*)\t(.*)%miU", $tabbed, $matches);
echo '<table border="1">
<tr>
<th>'.$matches[1][0].'</th>
<th>'.$matches[2][0].'</th>
<th>'.$matches[3][0].'</th>
<th>'.$matches[4][0].'</th>
<th>'.$matches[5][0].'</th>
<th>'.$matches[6][0].'</th>
<th>'.$matches[7][0].'</th>
<th>'.$matches[8][0].'</th>
<th>'.$matches[9][0].'</th>
<th>'.$matches[10][0].'</th>
<th>'.$matches[11][0].'</th>
<th>'.$matches[12][0].'</th>
<th>'.$matches[13][0].'</th>
<th>'.$matches[14][0].'</th>
<th>'.$matches[15][0].'</th>
<th>'.$matches[16][0].'</th>
<th>'.$matches[17][0].'</th>
<th>'.$matches[18][0].'</th>
</tr>';
for ($i=1; $i<count($matches[1]);$i++)
echo '<tr>
<td>'.$matches[1][$i].'</td>
<td>'.$matches[2][$i].'</td>
<td>'.$matches[3][$i].'</td>
<td>'.$matches[4][$i].'</td>
<td>'.$matches[5][$i].'</td>
<td>'.$matches[6][$i].'</td>
<td>'.$matches[7][$i].'</td>
<td>'.$matches[8][$i].'</td>
<td>'.$matches[9][$i].'</td>
<td>'.$matches[10][$i].'</td>
<td>'.$matches[11][$i].'</td>
<td>'.$matches[12][$i].'</td>
<td>'.$matches[13][$i].'</td>
<td>'.$matches[14][$i].'</td>
<td>'.$matches[15][$i].'</td>
<td>'.$matches[16][$i].'</td>
<td>'.$matches[17][$i].'</td>
<td>'.$matches[18][$i].'</td>
</tr>';
echo '</table>';
$content1=file("$form_data2");
print_r($content1);
$team2=$content1[1];
unset($content1[1]);
$tabbed=implode("",preg_replace('%[ ]{2,}%s', "\t", $content1));
preg_match_all("%(.*)\t(.*)\t(.*)\t(.*)\t(.*)\t(.*)\t(.*)\t(.*)\t(.*)\t(.*)\t(.*)\t(.*)\t(.*)\t(.*)\t(.*)\t(.*)\t(.*)\t(.*)\t(.*)%miU", $tabbed, $matches);
echo '<table border="1">
<tr>
<th>'.$matches[1][0].'</th>
<th>'.$matches[2][0].'</th>
<th>'.$matches[3][0].'</th>
<th>'.$matches[4][0].'</th>
<th>'.$matches[5][0].'</th>
<th>'.$matches[6][0].'</th>
<th>'.$matches[7][0].'</th>
<th>'.$matches[8][0].'</th>
<th>'.$matches[9][0].'</th>
<th>'.$matches[10][0].'</th>
<th>'.$matches[11][0].'</th>
<th>'.$matches[12][0].'</th>
<th>'.$matches[13][0].'</th>
<th>'.$matches[14][0].'</th>
<th>'.$matches[15][0].'</th>
<th>'.$matches[16][0].'</th>
<th>'.$matches[17][0].'</th>
<th>'.$matches[18][0].'</th>
</tr>';
for ($i=1; $i<count($matches[1]);$i++)
echo '<tr>
<td>'.$matches[1][$i].'</td>
<td>'.$matches[2][$i].'</td>
<td>'.$matches[3][$i].'</td>
<td>'.$matches[4][$i].'</td>
<td>'.$matches[5][$i].'</td>
<td>'.$matches[6][$i].'</td>
<td>'.$matches[7][$i].'</td>
<td>'.$matches[8][$i].'</td>
<td>'.$matches[9][$i].'</td>
<td>'.$matches[10][$i].'</td>
<td>'.$matches[11][$i].'</td>
<td>'.$matches[12][$i].'</td>
<td>'.$matches[13][$i].'</td>
<td>'.$matches[14][$i].'</td>
<td>'.$matches[15][$i].'</td>
<td>'.$matches[16][$i].'</td>
<td>'.$matches[17][$i].'</td>
<td>'.$matches[18][$i].'</td>
</tr>';
echo '</table>';
$fp = fopen("$form_data1", "r");
$flatfile = fread($fp, filesize("$form_data1"));
fclose($fp);
$spaces = str_repeat(' ', 10);
$new_str = str_replace('/', $spaces, $flatfile);
$new_str1 = str_replace('-', '.000', $new_str);
$fp = fopen("$form_data1", "w+");
fwrite($fp, $new_str1);
fclose($fp);
$fp = fopen("$form_data2", "r");
$flatfile = fread($fp, filesize("$form_data2"));
fclose($fp);
$spaces = str_repeat(' ', 10);
$new_str = str_replace('/', $spaces, $flatfile);
$new_str1 = str_replace('-', '.000', $new_str);
$fp = fopen("$form_data2", "w+");
fwrite($fp, $new_str1);
fclose($fp);
require('connect.php');
require('setting.php');
$season_id='2006';
$league_id='2006';
$pog=$_POST['pog'];
$comments=$_POST['comments'];
mysql_select_db("dnewby_nbalive",$db);
$insertSQL ="INSERT INTO boxscore (season_id, id, team, score, opponent, score1,ip,date,pog,comments) VALUES ('$season_id', '$game', '$team3', '$score', '$team4','$score1','$ip','$date','$pog','$comments')";
$Result1 = mysql_query($insertSQL, $db) or die(mysql_error());
$query_game = "SELECT id FROM boxscore ORDER BY id DESC LIMIT 1";
$game = mysql_query($query_game, $db) or die(mysql_error());
$row_game = mysql_fetch_assoc($game);
$totalRows_game = mysql_num_rows($game);
$game=$row_game['id'] ;
$fp = fopen("$form_data1", "r");
$flatfile = fread($fp, filesize("$form_data1"));
fclose($fp);
for ($i = 1; $i <= 10; $i++) {
$flatfile = ereg_replace(" {3}", " ", $flatfile);
}
$csv = ereg_replace(" {2}", ", ", $flatfile);
$csv1 = str_replace(chr(10), chr(10)."$season_id,", $csv);
$csv2 = str_replace(chr(10), chr(10)."$league_id,", $csv1);
$temp1 = str_replace(chr(10), chr(10)."$team2,", $csv2);
$temp = str_replace(chr(10), chr(10)."$team1,", $temp1);
$fp = fopen("$form_data1", "w+");
fwrite($fp, $temp);
fclose($fp);
$fp = fopen("$form_data1", "w+");
fwrite($fp, $temp);
fclose($fp);
$game_id_sql = "SELECT MAX(id) AS game_id FROM boxscore";
$game_result = mysql_query($game_id_sql);
$game_row = mysql_fetch_assoc($game_result);
$game_id = ",$game";
$data2 = file("$form_data1");
for($i=0;$i<count($data2);$i++)
{
$data2[$i] = "$game_id, " . $data2[$i];
}
$data2 = implode('\n\r', $data2);
$fp = fopen("$form_data1", "w+");
fwrite($fp, $data2);
fclose($fp);
$result = mysql_db_query('dnewby_nbalive' ,"LOAD DATA LOCAL INFILE '$form_data1' INTO TABLE stats FIELDS TERMINATED BY ',' LINES TERMINATED BY '\r\n'IGNORE 5 lines") or die(mysql_error());
The problem is its not submitting the team name in the $temp1 = str_replace(chr(10), chr(10)."$team2,", $csv2);
$temp = str_replace(chr(10), chr(10)."$team1,", $temp1); line. WHen it enteres it into the database it just leaves the team1 and team2 fields blank. Ive tried EVERYTHING to fix this and it just isnt working out.
Another thing. YOu see the INSERT INTO boxscore line ? It does enter the correct teams for that just not the row i mentioned.