Note that there are some explanatory texts on larger screens.

plurals
  1. POMultidimensional array with many sub arrays and mysql - how to deal with it?
    text
    copied!<p>I have very long multidimensional array that have many sub arrays. I would like to insert some value from them into mysql. I would be gratefull for some tip how to deal with it. I would like to use a loop that put only some value to one or different table in database. How I can get value from for example [Things][Thing][k][value]? Thanks for any advice.</p> <pre><code>Array ( [Data] =&gt; Array ( [A] =&gt; Array ( [B] =&gt; Array ( [0] =&gt; Array ( [C] =&gt; Array ( [value] =&gt; some value1 ) [D] =&gt; Array ( [value] =&gt; some value2 ) [E] =&gt; some value3 ) [1] =&gt; Array ( [C] =&gt; Array ( [value] =&gt; some value4 ) [D] =&gt; Array ( [value] =&gt; some value5 ) [E] =&gt; 5 ) ) [value] =&gt; ) [Things] =&gt; Array ( [Thing] =&gt; Array ( [F] =&gt; Array ( [value] =&gt; some value6 ) [G] =&gt; Array ( [H] =&gt; Array ( [0] =&gt; Array ( [i] =&gt; Array ( [value] =&gt; some value7 ) [j] =&gt; Array ( [value] =&gt; some value8 [value] =&gt; some value8 ) [k] =&gt; Array ( [value] =&gt; some value9 ) [l] =&gt; Array ( [value] =&gt; some value10 ) [m] =&gt; some value11 [n] =&gt; ) [1] =&gt; Array ( [o] =&gt; Array ( [value] =&gt; some value12 ) [p] =&gt; Array ( [value] =&gt; some value13 ) [r] =&gt; Array ( [value] =&gt; some value14 ) [d] =&gt; Array ( [value] =&gt; some value15 ) [t] =&gt; some value16 [u] =&gt; ) ) [value] =&gt; ) ) ) [Thing2] =&gt; Array ( (...) and so on... </code></pre> <p>In my database I have table for these things from array above. There is id in it of course and some other fields that are connected with other tables. As you can see below I would like to get some values from array, insert it into Table Thing, and some of them put into Table for field 4 and Table for field 5 and get id of them and put it into Table Thing. I'll use stored procedure. I would like to call it from php (I hope that this conception is good?). I have problem to get values that I want to get from this array so David Chan I'm looking for help with array and loop. I tried as Starx has written but I got nothing (white screen). I'm still learning so I know that I have to do something wrong.</p> <pre><code>............ ................. .................. Table Thing Table for field 4 Table for field 5 id int id int id int field 1 varchar value varchar value varchar field 2 varchar field 3 varchar ................ ................ field 4 int field 5 int (...) ........... </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload