1. A slight alteration to Chuckl's new query to show "all" customer records, not just newsletter-subscribers:2. Code edits:Code:insert into query_builder (query_category, query_name, query_description, query_string, query_keys_list) VALUES ('newsletters','My Address Export Query - All custs with phone number included','Special Query for Customer Data Export','select c.customers_telephone, c.customers_email_address, \nc.customers_lastname, c.customers_firstname, o.entry_street_address as customers_street_address, o.entry_suburb as customers_suburb,o.entry_city as customers_city, o.entry_state as customers_state, o.entry_postcode as customers_postcode from TABLE_ADDRESS_BOOK o, TABLE_CUSTOMERS c where c.customers_id = \no.customers_id GROUP \nBY c.customers_email_address order by c.customers_lastname, \nc.customers_firstname ASC','');
a) add the customers_telephone column-heading here:b) add the customers_telephone data output here:Code:if ($format == "CSV" || $format == "HTML") { $exporter_output .= $LINESTART; $exporter_output .= $FIELDSTART . "customers_email_address".$FIELDEND; $exporter_output .= $FIELDSEPARATOR; $exporter_output .= $FIELDSTART . "customers_firstname".$FIELDEND; $exporter_output .= $FIELDSEPARATOR; $exporter_output .= $FIELDSTART . "customers_lastname".$FIELDEND; $exporter_output .= $FIELDSEPARATOR; $exporter_output .= $FIELDSTART . "customers_telephone".$FIELDEND; $exporter_output .= $LINEBREAK; }Code:if ($format=="XML") { $exporter_output .= "<address_book>\n"; $exporter_output .= " <contact>\n"; $exporter_output .= " <firstname>" . $audience->fields['customers_firstname'] . "</firstname>\n"; $exporter_output .= " <lastname>" .$audience->fields['customers_lastname'] . "</lastname>\n"; $exporter_output .= " <email_address>" . $audience->fields['customers_email_address'] . "</email_address>\n"; $exporter_output .= " <telephone>" .$audience->fields['customers_telephone'] . "</telephone>\n"; $exporter_output .= " </contact>\n"; } else { // output non-XML data-format $exporter_output .= $LINESTART; $exporter_output .= $FIELDSTART . $audience->fields['customers_email_address'].$FIELDEND; $exporter_output .= $FIELDSEPARATOR; $exporter_output .= $FIELDSTART . $audience->fields['customers_firstname'].$FIELDEND; $exporter_output .= $FIELDSEPARATOR; $exporter_output .= $FIELDSTART . $audience->fields['customers_lastname'].$FIELDEND; $exporter_output .= $FIELDSEPARATOR; $exporter_output .= $FIELDSTART . $audience->fields['customers_telephone'].$FIELDEND; $exporter_output .= $LINEBREAK; }




