title: Need to Convert MySQL records to JSON tree
body: <p>I have some datasets which look like </p>
  
  <blockquote>
    <p>UID | VALUE | PARENTUID in MySQL. </p>
  </blockquote>
  
  <p>I would really appreciate if someone could tell me how to convert it into a JSON tree exactly like the one above.</p>
  
  <p>All the values are strings. I tried 3 solutions from StackOverflow but couldn't get them to work.</p>
  
  <p>example solution</p>
  
  <p><a href="https://stackoverflow.com/questions/4328515/convert-php-array-to-json-tree/7274134">Convert PHP array to JSON tree</a></p>