-----Original Message----- From: George Pitcher [mailto:george.pitcher@xxxxxxxxxxx] Sent: 08 May 2005 11:56 To: php-general@xxxxxxxxxxxxx Subject: I'm having a blond moment with a while loop??? Hi guys, I'm doing something dumb but I can't see it. The basic premise is: sql search of orders sorted by customer set g_customer_id to '' loop through resultset if customer_id not same as last record's customer_id (g_customer_id) get customer email details set up message header if this is the first record for a customer set item details else set item details --------------------- Try moving the next line to below "send email", It would be easier to help if you posted your code. set g_customer_id to customer_id --------------------- endif send email end loop The problem is that as a sample I have two records from one demo customer (me) and I can only get my email to handle one record - either sending separate records for each record or one email covering the last record only Its as if I should have another inner loop Any tips MTIA George -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Gamma Global : Suppliers of HPCompaq, IBM, Acer, EPI, APC, Cyclades, D-Link, Cisco, Sun Microsystems, 3Com GAMMA GLOBAL (UK) LTD IS A RECOGNISED 'INVESTOR IN PEOPLE' AND AN 'ISO 9001 2000' REGISTERED COMPANY ********************************************************************** CONFIDENTIALITY NOTICE: This Email is confidential and may also be privileged. If you are not the intended recipient, please notify the sender IMMEDIATELY; you should not copy the email or use it for any purpose or disclose its contents to any other person. GENERAL STATEMENT: Any statements made, or intentions expressed in this communication may not necessarily reflect the view of Gamma Global (UK) Ltd. Be advised that no content herein may be held binding upon Gamma Global (UK) Ltd or any associated company unless confirmed by the issuance of a formal contractual document or Purchase Order, subject to our Terms and Conditions available from http://www.gammaglobal.com E&OE ********************************************************************** ********************************************************************** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php