Im trying to dump data from a text file to mysql. The data is formated in this way:
"LuCyndi@infiniti.com","carol","kellerhals","109 veeder dr","las vegas","NV","89128","702-254-2061","45"
"the_prophet@att.net","a.","cohen","6794 e. bonanza rd","las vegas","NV","89110","702-463-6569","55"
"eleanor1229@aol.com","eleanor","aube","22 cedar lane","new paltz","NY","12561","845-255-2983","50"
I could parse it and just run a while loop but I know MySql has some sort of function to insert data from text files like that. Perhaps someone could show me some sample code?
If you dont know perhaps helping me with parsing it. Can i use a method like the one below?
$filename = "/home/htdocs/html/file.txt";
$fd = fopen ($filename, "r");
$textFileString = fread ($fd, filesize ($filename));
fclose ($fd);
$pinsArray = explode("\n", $textFileString);
foreach($pinsArray as $pin) {
echo "Preform function here";
}