Jump to content

Recommended Posts

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.

[quote][b]CATEGORY[/b]
  Building type 01
  Building type 02
  Building type 03

  Rating name
  Rating grade
  Rating percentage[/quote]

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...
[code]'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),
        );[/code]

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!
Link to comment
https://forums.phpfreaks.com/topic/13332-long-winded-array/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.