php - ignore last row of csv file -
we use ignore 1 lines
ignore 1st row of csv file. ignore
clause in load data local
query ignore last row of csv file?
and 1 more question,what query include field @ last row given in csv file http://temp-share.com/show/dpfsmga5w
right i've php-mysql code:
load data local infile '$url' table buzz fields terminated ',' enclosed "" lines terminated '\n' ignore 1 lines (day,exposures,clicks,earning,ctr,cpc,cpm)
try this:
<?php $filename = "file.csv"; //set csv file name $lines = file($filename); $count = count($lines); $count--; //decrease 1 remove last line for($i=0; $i<$count; $i++) { echo $lines[$i]; } ?>
Comments
Post a Comment