Hi Rudi, > I've been struggling for a while now so I thought I'd ask. > What's the easiest way to for to print group sql output. > For example I need to output customers grouped by zip. > Like: > zip > customer a > customer b > zip > customer d > customer e > zip > customer c > custoemr f > customer g > > Do I need to build array's and loop through them or > can I print straight from a record set ( using Postgresql or Mysql )
As a general rule, I would ask the RDBMS to do as much as possible (WHERE, GROUP BY, ORDER BY, HAVING), before handing the data to PHP - then use PHP to concentrate on getting the formatting/presentation (HTML) right! What you're asking for is quite common - and easy to implement (once you know how). Does that 'philosophy' answer your question, or were you wanting coding-level advice? If so, please post your current SQL query and if it's not too long, the pertinent part of your PHP prototype, and I/someone else here, will be happy to make suggestions. Regards, =dn -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php