Welcome Guest, Not a member yet? Register   Sign In
Best practice to return multidimensional array
#3

(This post was last modified: 05-06-2020, 09:57 AM by adqda.)

(05-05-2020, 09:39 PM)php_rocs Wrote: @adqda,

I'm going to assume that you are using a current version of MySQL.  Why don't you create a database view that has all of the information you need from all three tables.  Then in your CI model.  All you have to do is call the database view and you will have all the information you need.

hey thanks for your reply .. yes latest SQL and php 7.3

I never even thought about it .. Ive worked very little with views. I understand a database view is basically a fake database.. but how would the array nesting be any different than for a real table/s .

I guess the question is .  Do database views provide extra options to nest results from other tables within column values ,, ? in this case getting all the product images inside the specific product array under a product image column? and in this case naming the keys with column values

Sorry I dont have the jargon yet. Thanks for your suggestion.. I will definitely look into views further, be it or not what I need for this instance
Reply


Messages In This Thread
RE: Best practice to return multidimensional array - by adqda - 05-06-2020, 09:55 AM



Theme © iAndrew 2016 - Forum software by © MyBB