jeudi 22 février 2018

How to Write Nested while loop of php in laravel with mysql

can anyone tell me how to convert in this pseudo code in laravel? like inner loop sql table condition depend upon the value coming from parent loop.

while($row1 = mysqli_fetch_array($result)
{ 
      $query = select * from table where id=$row['id];
       $result2 = mysqli_query($query,$conn);

        while($row2 = mysqli_fetch_array($result2)
         {
             echo $row2['id'];
         }

}

any idea?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire