title: How to display a branch of tree via orgchart in php?
body: <p>I got 2 php files load.php for query</p>
  <pre><code>$sql = &quot;SELECT * FROM users where account_no = '0000000003' &quot;;
  
  
  try {
      $db = getConnection();
      $stmt = $db-&gt;query($sql);  
      $wines = $stmt-&gt;fetchAll(PDO::FETCH_OBJ);
      $db = null;
      echo json_encode($wines);
  } catch(PDOException $e) {
      echo '{&quot;error&quot;:{&quot;text&quot;:'. $e-&gt;getMessage() .'}}'; 
  }
  </code></pre>
  <p>other is the display.php with javascript</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script type='text/javascript'&gt;
  $(function(){
  var members;
  $.ajax({
    url:'load.php',
    async:false,
    success:function(data){
      members=$.parseJSON(data)
    }
  })
  
      //memberId,parentId,otherInfo
      console.log(members);
      for(var i = 0; i &lt; members.length; i++){
        
          var member = members[i];
        
        if(i==0){
          $("#mainContainer").append("&lt;li id="+member.account_no+"&gt;"+member.username+"&lt;br&gt;"+member.account_no+"&lt;br&gt;"+member.date_reg+"&lt;/li&gt;")
        }else{
          
          if($('#pr_'+member.upline).length&lt;=0){
            $('#'+member.upline).append("&lt;ul id='pr_"+member.upline+"'&gt;&lt;li id="+member.account_no+"&gt;"+member.username+"&lt;br&gt;"+member.account_no+"&lt;br&gt;"+member.date_reg+"&lt;/li&gt;&lt;/ul&gt;")
          }
          else{
            $('#pr_'+member.upline).append("&lt;li id="+member.account_no+"&gt;"+member.username+"&lt;br&gt;"+member.account_no+"&lt;br&gt;"+member.date_reg+"&lt;/li&gt;")
             }
          
        }
      }
            
  
  
      
    $("#mainContainer").orgChart({container: $("#main"),interactive: true, fade: true, speed: 'slow'}); 
  
  }); 
  
  
  &lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div  style="display: none"&gt;
  
  
  &lt;ul id="mainContainer" class="clearfix"&gt;&lt;/ul&gt; 
      
  &lt;/div&gt;
  &lt;div id="main"&gt;
    
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>My database I take screenshot:</p>
  <p><a href="https://i.stack.imgur.com/T7Iqb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/T7Iqb.png" alt="enter image description here" /></a></p>
  <p>Expected output for branch of tree the one I have circle of a red. on the image
  <a href="https://i.stack.imgur.com/pLwwz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pLwwz.png" alt="enter image description here" /></a></p>
  <p>I need help how to make it right. To view only selected tree branch.</p>