I have a form that collects data from about 100 fields. I would like to write this data to a delmited file and then process it (I will probably use LOAD DATA INFILE for this.
How do I collect the data and write it to a delmited file?
Why write it to a file first? Why not store it in the db direct? Use a temp or intermediate table if there is much processing to do before final storage.
To write to a cvs: create the record as a string with the embedded field and record delimiters, then use file_put_contents() http://uk.php.net/manual/en/function.file-put-contents.php to add the line to the end of your file.
Thanks, but unfortunately I am working with PHP 4.3.2, so do not have that function available.
What would be a quick and dirty way to write the data to a file, to prepare to load using something like "Load Data Infile"?