Export data into csv issue.

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
vinodkumar
Forum Newbie
Posts: 4
Joined: Thu May 29, 2014 12:15 am

Export data into csv issue.

Post by vinodkumar »

Hi sir,
In cakephp we are using one CsvComponent.
Can i put comma(,) as a third parameter into fputcsv function then any problem is there?
why because i am facing some small issue in exporting data into csv.if i passed other than comma(,) as a third parameter in fputcsv function like semicolon(;) then i am facing issue.That is if any field value with comma,then after that those data what ever it is not coming into csv file.Please clarify my dought as soon as possible.i am waiting for your reply.

Thanks & Regards,
VinodKumar.
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Export data into csv issue.

Post by Celauran »

vinodkumar wrote:if i passed other than comma(,) as a third parameter in fputcsv function like semicolon(;) then i am facing issue
Semicolon, pipe, or whatever should work fine. Can you please elaborate on the problem you're facing?
vinodkumar
Forum Newbie
Posts: 4
Joined: Thu May 29, 2014 12:15 am

Re: Export data into csv issue.

Post by vinodkumar »

can i use comma as a csv delimiter(third parameter) in fputcsv() function in php?
Please let me know.
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Export data into csv issue.

Post by Celauran »

Comma is the default parameter.
vinodkumar
Forum Newbie
Posts: 4
Joined: Thu May 29, 2014 12:15 am

Re: Export data into csv issue.

Post by vinodkumar »

1) I am fetching the data from database and export into csv file.while i am fetching the data from database if any column value has special character like comma(,) then after that column remaining data for particular record is not coming into csv. I was used csv delimiter as a semicolon(third parameter) in fpucsv() function.

2) In above case the data is not coming into csv file.

Please let me know.
Post Reply