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

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -