I want to put a new line break on the records that i am retrive using CVS file. I am retrieving data from mysql database into a csv file but could not break up the data when it is displayed. This is how it is displaying below:
1,4,Yes ,1\nenabled\n1,4,Yes ,1\nenabled\n2,4,No ,2\nenabled\n1,4,Yes ,1\nenabled\n2,4,No ,2\nenabled\n3,4,Not sure ,3\nenabled\n1,4,Yes
I need to put a new line break on the code below. Can someone identify my error or tell me how to use new line break in php please.
while ($row = mysql_fetch_array($result)) {
// this sticks the results row by row into an array called $row.
// rows are called via $array_name["COLUMN_NAME"]
//$out =
$out .= $row["id"].',';
$out .= $row["id_question"].',';
$out .= $row["answer"].',';
$out .= $row["position"].'\n';
$out .= $row["status"].'\n';
echo $out;
Thanks.