I think something like this would do the job...
<?php
$fp = fopen("mailinglist.csv", "r");
$length = 4096; /// have to be optional length ...
$fildDelineate = ','; /// or "|" ... declare what you need
$databasetable = 'tableName';
$counter = 1; // to omission first row if it is table headers
while( !feof($fp) ) {
if( !$line = fgetcsv($fp, $length, $fildDelineate, '') && $counter) {
continue;
}
foreach($line as $key => $value){
// For example insert in 3 column (e.g. id, name, email )
$importSQL = "insert into $databasetable values('$line[0]','$line[1]','$line[2]')";
mysql_query($importSQL) or die(mysql_error());
}
$counter++;
}
fclose($fp);
?>