0

How do i store valid form inputs in a csv file? I am not sure how to start, but I know that php and mysql is involved.

3
Contributors
7
Replies
8
Views
4 Years
Discussion Span
Last Post by <M/>
0

You don't need MySQL to store data in a CSV, if you are using CSV for storing data rather than reporting on or exporting data, then I would have to wonder why you aren't just storing it in MySQL.

The function you need is fputcsv, plently of examples on google.

0

I was researching and I noticed an fopen function, is that any good?

0

fopen gives you a handle to a file, you then need to use another function (Such as fwrite, fputcsv...) to put data into the file.

0

use explode() and fputscv(). if it's from an input use while loop or any other looping statement which ever you prefer and store it in an array. use explode() and foreach() for fputcsv() this was my problem also last year, but through extensive "googling" and brain storming my own brain. i finally figure out the answer.

0

I am going to look into that, by any chance do you still have the source code that you used in solving this question a year ago?

I was told to look into fputcsv but i didn't realize explode was needed... Well good thing I'm still learning :)

0

I made a typo here:

I was told to look into fputcsv but...

It should've been fputscv :)

0

Okay, so I have attempted a few things but I can't get it to work... Can you guys write me a sample snippet?

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.