Hi all
I have posted similar type thread previously but now i want to know some thing more about the tab delimiter.
I have few records in the mysql db and i am exporting those records through a csv file in excel format.
My question:
1.Cant i use tab as a delimiter while exporting the records in a csv file?
say,
I have these records
Name age products
A 34 B,C,D
E 35 F,G,H
Now these commas(B,C,D) will be stay in the excel file but will be separated by a tab………..How is it possible?
My php code is here:
[code=php]$file_pointer = fopen(“sample.csv”, “w”);
fwrite($file_pointer,””);
fwrite($file_pointer,$string);
fclose($file_pointer);
$file_pointer=fopen(“sample.csv”, “w”);
fwrite($file_pointer,”ICODE,STK,POC,BOCC,BOCU,TYPE,DESIGN,D1,D2,HT1,HT2,LIST,CIDn”);//shall i use tab here if so then how?
$sql_email =”select * from product where cid='{$_GET[‘cid’]}'”;
$result=mysql_query($sql_email);
while($row=mysql_fetch_array($result))
{
//data fetch
fwrite($file_pointer,”$icode,$stk,$poc,$bocc,$bocu,$type,$design,$d1,$d2,$ht1,$ht2,$list,$cidn”);
}
fwrite($file_pointer,$string);
fclose($file_pointer);
header(“location:download.php?file=$cname.txt”);
Please suggest me how to proceed,
Thanks in advance
Raj