Hello everyone:
The database project I am working on needs to include the capability for site users to import .csv files into the mySQL database.
Does anyone know of some good instructions on the web for this type of coding?
Thank you:
Pavilion
Allow users to import csv files
Moderator: General Moderators
Re: Allow users to import csv files
You'll want to take a look at fgetcsv(). Just remember, never trust user input! Make sure everything is properly type cast and sanitized. Consider using prepared statements.
Re: Allow users to import csv files
Thanks Celauran - I did some research on fgetcsv() and ended up finding this. Do coders use these kinds of "classes" very much?
And if classes can be helpful in the coding process, how do you evaluate them before downloading?
Thanks Much - Pavilion
And if classes can be helpful in the coding process, how do you evaluate them before downloading?
Thanks Much - Pavilion
Re: Allow users to import csv files
A comma-separated values (CSV) file stores tabular data (numbers and text) in plain-text form. Plain text means that the file is a sequence of characters, with no data that has to be interpreted instead, as binary numbers. A CSV file consists of any number of records, separated by line breaks of some kind; each record consists of fields, separated by some other character or string, most commonly a literal TAB or comma. Usually, all records have an identical sequence of fields.
Re: Allow users to import csv files
Looks interesting. Makes sense to make use of existing tools rather than constantly reinventing the wheel, no?Pavilion wrote:Thanks Celauran - I did some research on fgetcsv() and ended up finding this. Do coders use these kinds of "classes" very much?
Looks through the source to see what it does and how it's written.Pavilion wrote:And if classes can be helpful in the coding process, how do you evaluate them before downloading?