使用PHPExcel将筛选结果导出到Excel

I'm trying to build a report page for my company. I want to export the filtered results.

I built a page with dreamweaver on localhost. The query works well and gives me the results.

I then added a form (https://dl.dropboxusercontent.com/u/5326510/C74tables.php lines 316-324) with 3 hidden fields and a button to go to exportXLS.php when clicked. I have it working but it downloads all the rows in the table.

SELECT * FROM satislar WHERE satis_satici LIKE v3 AND satis_tarih between v1 and v2 ORDER BY satis_tarih DESC

(v1, v2 and v3 are the variables in the recordset)

exportXLS.php https://dl.dropboxusercontent.com/u/5326510/exportXLS.php exports all the rows not the filtered results.

How can I get the filtered results?

Maybe you should change the line:

$SQL='SELECT cus_id, mus_musteriadi, mus_pstnno, urun_satilanurun, satis_satici, satis_tarih FROM satislar';

for:

$SQL='SELECT cus_id, mus_musteriadi, mus_pstnno, urun_satilanurun, satis_satici, satis_tarih FROM satislar WHERE satis_satici LIKE v3 AND satis_tarih between v1 and v2 ORDER BY satis_tarih DESC';