MySQL Database Php

# declare some variables
$ServerName='';
$UserName='';
$Password='';
$filename=''; # Text file to read
$TableName=''; # Table to be filled.
mysql_connect("$ServerName", "$UserName", "$Password");
$fd = fopen($filename, "r");
while ($record = fgets($fd, 4096)) {
$field = explode("|", $record); # '|' is the character which seperates the
fields.
$query = "INSERT INTO $TableName VALUES ($field[0], '$field[1]')"; #Use as many fields as you need.
$result = mysql_db_query("$ServerName", $query);
if ($result) {
echo "

$field[0] was added to the database

"; # Use any field you need.
}
}
fclose($fd);
?>