Link to home
Start Free TrialLog in
Avatar of redcoder
redcoder

asked on

read second row of csv file using php

Anyone know how to read a second row of a csv file using PHP?
 I want to import only starting from second row onwards of the csv file into mysql.
Avatar of steelseth12
steelseth12
Flag of Cyprus image

LOAD DATA INFILE 'pathtocvsfile' INTO TABLE tablename IGNORE 2 LINES;

For more info look at http://dev.mysql.com/doc/refman/5.0/en/load-data.html
Avatar of redcoder
redcoder

ASKER

Is it possible to use those command with php? I tried with :

mysql_query("LOAD DATA INFILE 'vehicledata.csv' INTO TABLE 'vehicledatatemp' FIELDS TERMINATED BY ',' IGNORE 2 LINES ");    

 in php but it doesn't work
ASKER CERTIFIED SOLUTION
Avatar of steelseth12
steelseth12
Flag of Cyprus image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
great. that really works.

 you are great steelseth12..

:-)

Glad i could help.
Thank you for the points and the grade.