try:
$fp = fopen("data.txt", "r");
while(!feof($fp)) {
// This gets the line up till the \n
// Or until the buffer limit 1024 is reached
$line = fgets($fp,1024);
$nice = explode(",",$line);
// I use mysql but you can do whatever. 🙂
$query = "Insert into blah values('nice[1]', nice[2],'nice[3]')";
MYSQL_QUERY($query);
}// end while
So basically its just like adding 1 row... just do it in a loop. 🙂