Jump to content


Photo

Long winded array


  • Please log in to reply
No replies to this topic

#1 gijew

gijew
  • Members
  • PipPipPip
  • Advanced Member
  • 240 posts
  • LocationCalifornia

Posted 30 June 2006 - 07:41 PM

Hey everyone,

Been a while since I've posted but I'm stuck on the best way to write this array out.  I've had it in a database but I'm sick of writing 2 applications for every database table (1 for user, 1 for admin) so I decided to stick these types of things in arrays instead.  My big problem is that I'm not used to working with array's as much but once I get it down, it'll make my life MUCH easier.

Here's the layout.

CATEGORY
  Building type 01
  Building type 02
  Building type 03

  Rating name
  Rating grade
  Rating percentage


So basically I have about 5 or 6 categories that I need to list building types for.  The ratings should actually be associated with the category and not the building types.  If I were to query this I would just do a join between a few tables using the category id as the key.

Here's an actual example of what I'm trying to make work...
'Mixed Use & Multifamily 5+' => 
  array('Buildings' =>
            array ('Combination of Commercial and Residential', 'Multi-Family 5+ Units'),
          'Mixed Use & Multifamily 5+ Ratings' => 
            array('Excellent','A+',80),
            array('Excellent','A',80),
            array('Good','A-',70),
            array('Fair','B',70),
            array('Poor','C',55),
         );

Retrieving the data from the array isn't all that big of a deal, just creating the actual array is since I need to be able to access the 3 sections independantly or have them combined by the category (that makes sense right?).

Thank you in advance!
I'm considered good looking in some countries




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users