I have a my sql table called pvdata, I would like to export it to csv file.
But I\'m obtaining the following results instead of the normal looking table:
I don't know if it is a typo, but within your script are spaces before the
this will result in an html document being delivered and your header-calls will fail. So remove the spaces and any other output before "header" calls.
You are getting error messages up there, for a quick solution try:
error_reporting(0);
Line 28: $header is not known, this makes
$header .=
appending to a unknown variable.