php looping when looping second loop
<p>I have three tables   section,section_usertype,SystemUType</p>

<p>I have the section table that keeps the master data and    section_usertype stores the 
section_id data from the section table 
idSysUsers data from the   SystemUType table
The idsysusers hold multiple  ids wrt section_id in the  section_usertype table.</p>

<p>The 
$row im able to get the  Section_Id,Section_Name etc but not the  idSysUsers assigned to that section .
Im having problem with the looping ,could you help me?
Code is given below</p>

<pre><code>    &lt;?php
     $rs = mysqli_query($dbc,"SELECT `Section_Id`,`Section_Name`,`Section_Description`,`Image_Path` FROM `section`  limit $offset,$rows");
        $items = array();
      while($row = mysqli_fetch_object($rs))
      {
       $idSysUsers_qry = mysqli_query($dbc,"select `Section_User_Id`,`Section_Id`,`idSysUsers` from section_usertype where Section_Id='".$row-&gt;Section_Id."'");    


      while($rowsysusers = mysqli_fetch_object($idSysUsers_qry))
      {
      $qUTdd = "SELECT  idSysUsers,uid,uidname,userTypeRol  from SystemUType where  `SystemUType`.`idSysUType` = '".$rowsysusers-&gt;idSysUsers."'"; 
      $rUTdd = @mysqli_query ($dbc, $qUTdd);  
    $fetchuserrole =  mysqli_fetch_object($rUTdd) ;   

      $userTypeRole[]  =   $fetchuserrole-&gt;userTypeRole;  

      }

// $row im able to get the  Section_Id,Section_Name etc but not the  idSysUsers assigned to that section .

        $row = array(   
         'Section_Id' =&gt;$row-&gt;Section_Id,
        'Section_Name'=&gt;$row-&gt;Section_Name,
            'Section_Description'=&gt;$row-&gt;Section_Description,
            'Image_Path'=&gt;$row-&gt;Image_Path,
        'idSysUsers'=&gt;$userTypeRole
          );
            array_push($items, $row);


      }
    ?&gt;
</code></pre>
