CSV export

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
guitarlvr
Forum Contributor
Posts: 245
Joined: Wed Mar 21, 2007 10:35 pm

CSV export

Post by guitarlvr »

I have created a script using the fgetcvs() function (very cool might i add). It echos the data to the screen as well as inserts the data into a mysql database. I am wondering if you can do the opposite with the same function to extract the data from the database and into a CSV file or if i have to do that manually. Any thoughts?

Thanks,

Wayne
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

You should be able to use the file system functions to do that. file(), fputs(), etc...
User avatar
guitarlvr
Forum Contributor
Posts: 245
Joined: Wed Mar 21, 2007 10:35 pm

Post by guitarlvr »

Thats what i was thinking. I didnt know if i could use fgetcsv in reverse or not. I can use file() and fputs() though.

Thanks!
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

fputcsv() anyone?
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

I swear I looked for that function and didn't find it. Man, I need to look around better.
User avatar
guitarlvr
Forum Contributor
Posts: 245
Joined: Wed Mar 21, 2007 10:35 pm

Post by guitarlvr »

Thats exactly what i was looking for. Thanks a lot guys!

Wayne
Post Reply