Export Results table csv file
I believe Ray helped me build a page to download the results table into a .csv file. I've tried to apply the same code to a new table, but when viewing the csv file, i am getting the correct number of rows, but each row is a repeat of the data in row 1 from my database. I know this isn't a WA question, but if you're able to help I'd greatly appreciate it.
Here is the code on the page...
<?php
header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-Disposition: attachment; filename=report.csv");
header("Content-type: application/octet-stream");
header("Content-Transfer-Encoding: binary");
?>
School,Student Last, Student First, Pledge Amount
<?php do { ?>
<?php echo $row_WADAorderdetails['DetailSchool']; ?>,<?php echo $row_WADAorderdetails['DetailStudentL']; ?>,<?php echo $row_WADAorderdetails['DetailStudentF']; ?>,<?php echo $row_WADAorderdetails['DetailPrice']; ?>,
<?php } while ($row_WADAorders = mysql_fetch_assoc($WADAorderdetails)); ?>
<?php
mysql_free_result($WADAorderdetails);
?>