Saving Data to CSV? - Page 2

User 2147646 Photo


Registered User
233 posts

Eric Rohloff wrote:
You need to use a little php to sparse the file. I use mysql myself but Prism is our resident expert on csv to php. He may chime in here at some time but until then this should get you started.
<?PHP

$file_handle = fopen("form-results.csv", "r");

while (!feof($file_handle) ) {

$line_of_text = fgetcsv($file_handle, 1024);

print $line_of_text[0] . $line_of_text[1]. $line_of_text[2] . "<BR>";

}

fclose($file_handle);

?>

Thanks for this Eric!
What would be the best way to style this so that the headers and values can be centered in columns?

User 187934 Photo


Senior Advisor
20,271 posts
Online Now

Does this fit your needs?
form_to_csv
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.