Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
$filename="filename.csv";
$handle=fopen($filename,"w");
fwrite($handle,$commaseparatedcontents]);
fclose($handle);
header('Content-type: application/xls');
header('Content-Disposition: attachment; filename="filename.csv"');
readfile($filename);
while (you are running through your DB){
$myvariable.="$row['fieldname1'][red],[/red]$row['fieldname2'][red],[/red]...";
}
$contents[red].[/red]="$row['fieldname1'],$row['fieldame2']...\r\n";
I meant the new row to the same variable. Not new variable.Not really, you can just concatenate the new row to the new variable,
making sure to use an end of line character. such as "\r\n" to terminate a row.
$commaseparatedcontents.="1,2,3[red]\r\n[/red]";
$commaseparatedcontents.="4,5,6,7";
$commaseparatedcontents.="<table><tr><td><font color=#FF0000>Red</font></td><td><font color=#0000FF>Blue</font></td></tr><tr><td><b>Bold</bold></td><td>Normal</td></tr></table>";