> I've done this before in coldfusion.
> It's the one thing I'm note sure on how to do the same(ish)
> in PHP - my language of choice.
> If we have the record set the CF code would look like
> <cfoutput query="customers> group="zip"> <!--- loop through record set --->
> <cfoutput> <!--- inner loop on group by zip --->
> So I'm think also to use 2 loops for the same purpose in PHP.
> Can I do this from the record set like above or do I need
> to build array's I wonder ?
No need for arrays - the resultset from the RDBMS effectively is one - SQL-talk says
it's a table (please show
us your SQL query if you have any doubt about this). Make sure the SQL resultset is
You're approach looks right to me - just more CF than PHP-like. How's this?
check result ok/have at least one row
extract first row
WHILE not EoD
note zip code
ECHO zip heading
WHILE this row's zip == noted zip AND not EoD
ECHO customer data
end while zip
extract next row from resultset
end while data
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php