将文本文件装入MySQL表
<? 
# 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($fd4096)) { 

$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 
"<p>$field[0] was added to the database</p>"# Use any field you need.