Código PHP:
  
<form id="form1" method="post" action="insertaZD.php" enctype="multipart/form-data">
            <table width="955" height="200" >
                <thead>
                    <tr align="center">
                        <th>Imagen</th>
                        <th>Numero de Pedido</th>
                        <th>Estado</th>
                        <th>Comentarios</th>
                        <th>SKU Zapato</th>
                        <th>Cantidad</th>
                        <th>Size</th>
                        <th colspan="2">Acciones</th>
                    </tr>
                </thead>
                <?php
                        require ('conexion/conecta.php');
                        
                        //mostrar todo en la tabla PEDIDO donde este el usuario activo
                        $us=$_SESSION['usu'];
                        $qry="select * from pedido where id_Usuario=$us"; 
                        $qry2=mysql_query($qry, $con);
 
            
                        if(!$qry2){
                             echo mysql_error();
                             }
                        while($row = mysql_fetch_array($qry2)){
                       
 
 
                       /////////////////////////
 
                       $qry1="select id_Zapato from pedido where id_Usuario=$us"; 
                            $zap=mysql_query($qry1, $con);
                        
                        
                        while($rox = mysql_fetch_array($zap)){
                    
                    $zaps=$rox['id_Zapato'];
                    $img="select Imagen from zapato as z inner join pedido as p on (z.id_Zapato = p.id_Zapato) inner join usuario as u
                              on (u.id_Usuario = p.id_Usuario) where p.id_Zapato=$zaps and p.id_Usuario=$us; "; 
        
                            $img2=mysql_query($img, $con) or die("error");
                       
                       /////////////////
 
                       while($rot = mysql_fetch_array($img2)){
                ?>
            <tbody>
                <tr align="center">
                    <td><div align="center"><img src="images/productos/<?php echo $rot['Imagen'];?>" width="65" height="52"/></div></td>
                    <td><div align="center"><strong><?php echo $row['id_Pedido'];?></strong></div></td>
                    <td><div align="center"><strong><?php echo $row['Estatus'];?></strong></div></td>
                    <td><div align="center"><strong><?php echo $row['Comentario'];?></strong></div></td>
                    <td><div align="center"><strong><?php echo $row['id_Zapato'];?></strong></div></td>
                    <td><div align="center"><strong><?php echo $row['can_Pedido'];?></strong></div></td>
                    <td><div align="center"><strong><?php echo $row['siz_Pedido'];?></strong></div></td>
                    <td><a href="actualizaD.php?id=<?php echo $row['id_Zapato'];?>"><img src="images/iconos/actualizar.png"/></a></td>
                    <td><a href="eliminaZD.php?id=<?php echo $row['id_Zapato'];?>"><img src="images/iconos/eliminar.png"/></a></td>
                      
                      <?php } ?>  <?php } ?> <?php } ?> 
                    
                </tr>
                    
                    
            </tbody>
            </table>
        </form>    
 
 PhP While anidados
 PhP While anidados 

 Este tema le ha gustado a 1 personas
Este tema le ha gustado a 1 personas