I would like to read a text file into a mysql table. The format of the text file is
"U98401","1-604-501-0612","","WIRE ROPE INDUSTRIES LTD.","","", etc for each record.
I would like to have each value between the quotes placed into a variable which can then be "INSERT INTO" a Mqsql database. I have gotten to making a connection and have been able to send some test data to the database so that parts working. Now i just need what goes in between the "while" statement?
while(!feof($fpread))
{
$str = fgets($fpread, 255);
parse_str($str);
$query = "INSERT INTO
$dbTable VALUES
(
$var1, $var2 etc
)";
MYSQL_QUERY($query);
}
I know this will be a pretty simple task for most but I am still learning.
Thanks
"U98401","1-604-501-0612","","WIRE ROPE INDUSTRIES LTD.","","", etc for each record.
I would like to have each value between the quotes placed into a variable which can then be "INSERT INTO" a Mqsql database. I have gotten to making a connection and have been able to send some test data to the database so that parts working. Now i just need what goes in between the "while" statement?
while(!feof($fpread))
{
$str = fgets($fpread, 255);
parse_str($str);
$query = "INSERT INTO
$dbTable VALUES
(
$var1, $var2 etc
)";
MYSQL_QUERY($query);
}
I know this will be a pretty simple task for most but I am still learning.
Thanks