Well, using your txt file as a template:
<?php
$breaks = Array("\n", "\r\n", "\r", "<br>", "<br />");
$contents = file_get_contents('smith.txt');
$lines = explode("\r\n", $contents);
$pattern = "/([a-zA-Z0-9.\.\/\,\s]*):\s([a-zA-Z0-9.\.\/\,\s]*)/";
$i = 0;
foreach($lines as $line)
{
if($line != '' || !empty($line))
{
if($line == 'Education:')
{
$education = $lines[$i+1]."\n".$lines[$i+2];
}
@preg_match($pattern, $line, $info);
@$info[1] = strtolower(@str_replace(" ", "_", $info[1]));
if(preg_match("/([0-9_]*)children*/", $info[1]))
{
preg_match("/([0-9_]*)[a-z]*/", $info[1], $cnt);
$offset = strlen($cnt[1]);
$info[1] = substr($info[1], $offset);
}
${@$info[1]} = @$info[2];
}
$i++;
}
$dbc = mysql_connect('localhost', 'username', 'password');
mysql_select_db('db_name', $dbc);
$sql = "INSERT INTO `table` (Team, FirstYearPlayed, Drafted, DraftAgain, Gender, Family, Children, Birthdate, Birthplace, HomeCity, Religion, Education) VALUES ('$current_team', '$first_year_played', '$last_drafted', '$up_for_draft_again', '$gender', '$family', $children, $birth_date, $birthplace, $home_city, $religion, $education)";
$result = mysql_query($sql);
if(!$result)
{
echo 'Query Failed!!';
}
else
{
echo 'Query Successful!!';
}
?>
That's what I came up with....
~Brett