ok I got it working, but the SQL is throwing out syntax errors on some of my queries. for example:
$rows->setQuery("SELECT * FROM newsletter WHERE NewsLetterOptIn = 1 AND NewsLetterEmail IN (SELECT OrderBuyerEmail FROM `orders` WHERE OrderCouponCode != "")");
This is the error: Parse error: syntax error, unexpected '")"' (T_CONSTANT_ENCAPSED_STRING) in /homepages/41/d416416140/htdocs/admin/exports/export-voucher-customers.php on line 10


