Click to See Complete Forum and Search --> : Rebuilding Arrays Intelligently


chuckdawit
06-19-2007, 11:16 PM
I'm looking for an intelligent way to rebuild arrays that I have pulled out of my db. I have two tables one of addresses (street, city, state, etc) and one table containing a combined column of phone numbers, fax numbers and email addresses. They look like this:
1,'2H Technologies, Inc.','23456 Madero Suite #185','Mission Viejo','CA', '92691', 'USA', 0
-where the last value of 0 is a key (either 0/1/2 representing a type of address) and then I have my other table with columns like:
'949-600-5866',1,0
'http://www.2htec.com',1,2

-where the last value (0/1/2) represents either a phone,fax,email number. And the second to last value represents the address that the value(phone,fax,email) belongs too.
I have to rebuild each phone number, fax number and email back into the corresponding address array but I'm looking for a way to do it without creating a looping nightmare. Is there a more intelligent way of of traversing through all the arrays that I've fetched and stored from my db?