title: Serialized array save to mysql with php and orderby
body: <p>This is javascript serialized array:</p>
  
  <pre><code>[{"id":1},{"id":2},{"id":3,"children":[{"id":4,"children":[{"id":5},{"id":6},{"id":7}]},{"id":8}]}]
  </code></pre>
  
  <p>How to save this (dynamic) to mysql with php like this:</p>
  
  <pre><code>***********************************
  |  id  |   subsite_id  | orderby  |
     1           0            0
     2           0            1
     3           0            2
     4           3            0
     5           4            0
     6           4            1
     7           4            2
     8           3            1
  ***********************************
  </code></pre>
  
  <p>Thanks for answer.</p>