Jump to content

[SOLVED] Full Proof Arrays


Ninjakreborn

Recommended Posts

I have a really large system that pulls lot's of stuff from a database.

From about 4-5 different queries it runs arrays of data into arrays from the fields.

I have a products array on the first one which collects customers, products and other information.

As follows

[customerid]

   [customername]

   [customerid]

   [products]

      [productid and information in this array]

 

Basically this is the array setup that is created at first.

However when it goes through future database structures new customers might get added entirely

(which should add a new customer id and customer details).

Or some NEW products might get added(which need to add without having a chance of overwriting current projects.

Then again some products might have data that need's to be added to that specific product.

Does anyone have a tutorial, tips, tricks on writing "intellegent" arrays?

 

 

 

 

Link to comment
Share on other sites

I'm confused.  You said you have a large system that builds these arrays with data from the database.  You then say that new entries would be added to the database and you're not sure how to insert this data into the array.

 

Are you saying that this array is pre-built somewhere else?  Another way of phrasing that question would be are you not querying directly from the DB each time you access this data?  If the answer is yes then I have to wonder if there's not a more efficient way of querying the database for the data you need.

 

How about providing a (small) example of what this array ultimately looks like using print_r() as well as your table structure.  Then we can maybe help you query for the data directly in the format you want it.

Link to comment
Share on other sites

I can't mess with the models.  Only the controllers and view files.

I have another developer that handles all the models.

Basically (I can't reveal much) but basically there are 3 databas calls.

Which gather data.

The query calls provide all the data that i need to form the arrays.

It's just I am having a hard time getting them to fall into place correctly.

 

Because of my lack in information I might be on my own.

I just don't want to accidentally reveal anything that might get me in trouble with the client.

The system, code, and app are all closed source and for internal usage.

So I can't accidentally reveal anything that will get me screwed.

Link to comment
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.