View Full Version : parsing csv
12-24-2003, 05:02 AM
I have a friend who has asked me to take some excel files which he has made csv files and create a web page to where he can simply upload the file and have it parsed into a database.
I have not done this before and was wondering if anyone could point me in a good direction on how I could go about doing this.
12-24-2003, 05:12 AM
Most often csv files are just formatted text files, ask for an example of the csv file and then you can decide the best method to parse it.
12-24-2003, 05:38 AM
I hae tried a few ways I have even used the fgetscsv() function for php, it will parse it just fine to another flat file, however it seems to fill my db with nothing but null values when I try to write to the database, I am thinking that since some of the fields are blank that mysql has a problem with that.
12-24-2003, 05:47 AM
it should not bother mysql that some of the fields are blank. what I would do is instead of executing your query just echo it. Then you can see exactly what the query looks like. If your query looks fine look for an error in the syntax with mysql_error()
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.