Fwrite help csv output issue

Hi all,

some help needed here.

I have managed to create an csv output by using fwrite from an Oracle database, great!
Now when I run the page “standalone” the csv is generated correctly.

Problem is that I need to pass some variables into the sql, the query works no problem
however when the form submit is pointed towards the fwrite output file the current html
page is saved as csv instead of the query.

What am I doing wrong?

thanks,

Yannick

Cannot possibly help with what your code is doing without having all the relevant code.

Some guesses - you are downloading the .csv file as part of a html page and the html being output on that page becomes part of the download (to download a file the http response must only be the headers and the file contents) or you are using output buffering to capture the output being produced to write to the .csv file and that is including any html being output too or you are using ajax and the page being requested includes html, not just the result from the sql query.

I/others can probably list more possible causes, but you can see why we would need to know what your current relevant code is in order to narrow down the possibilities

Sponsor our Newsletter | Privacy Policy | Terms of Service