<?
$fp=fopen("mcode2.txt","r") or die("Cant open file");
$i=1;
include("opendb.php");
while(!feof($fp))
{
 $line=fgets($fp,1024);
 $spline=explode("~",$line);
//$code=substr($spline[0],3,4).substr(time(),7,3);
//$code=str_replace(' ','-',$code);

$mcode=trim($spline[0]);
$config=trim($spline[1]);
$gvw=$spline[2];
$wbase=trim($spline[3]);
$tyrefr=trim($spline[4]);
$tyrerr=trim($spline[5]);
$cat=trim($spline[6]);


$sql="insert into veh_master (mcode,config,gvw,wbase,tyrefr,tyrerr,cat) values('$mcode','$config','$gvw','$wbase','$tyrefr','$tyrerr','$cat')";
print $sql."<br>";
mysqli_query($db,$sql) or die(mysqli_error());

}
?>
