This code produces *this data.
$fp = fopen("talondata/harley.pb","r");
$content .= "insert into inventory values";
while($data = fgets($fp, 1024))
{
$i++;
$part = trim(substr($data,0,18));
$desc = trim(substr($data,18,47));
$cost = trim(substr($data,76,8));
if($i == 200)
{
$content = substr($content,0,-2).";\n\n";
$content .= "insert into inventory values";
$i=0;
}
$content .= "(\"$part\",\"$desc\",\"$cost\",\"0\"),\n";
}
$content = substr($content,0,-2).";";
$content = str_replace("\\","/",$content);
fclose($fp);
$fp = fopen("harleypb.txt","w+");
fwrite($fp,$content);
fclose($fp);
*
insert into inventory values("AA0402.1CZ","CAP SCREW, SOCKET HEAD, 1/4-20 X 1/4 D","0.550","0"),
("AA0402.20CBL","SCREW 1/4 X 1/4 SHLD SH AL D","2.950","0"),
...........
("AN1007.3CBL","SCREW","0.600","0"),
("AN1007.3FBL","SCREW, BUTTON HEAD","1.000","0");
200 records of values (),() and then it goes to a new insert statement.
At the end of the file I get:
ERROR 2006 at line 122409: MySQL server has gone away.
-Kazer