Ver Mensaje Individual
  #1 (permalink)  
Antiguo 18/11/2009, 11:29
Avatar de jdelrioj
jdelrioj
 
Fecha de Ingreso: julio-2008
Ubicación: La Rambla , Córdoba -> Andalucía
Mensajes: 340
Antigüedad: 15 años, 9 meses
Puntos: 13
Que fallo veis en este código

Código PHP:
<?php 
$ParamIdVeh
=$row[5];         
        
$sentencia="SELECT Vehiculo, Orden, Articulo, Descripcion, Cantidad, Imagenweb1, Imagenweb2, Instruccion 
        FROM cr_guiaproductos 
        WHERE Vehiculo=$ParamIdVeh; "
;
        
$resultado2mysql_query($sentencia);
        
$bandera 0//Para comprobar si existen articulos para ese vehiculo
        
        
while ($registro=mysql_fetch_array($resultado2MYSQL_NUM))
            {
                
                
                if(
$registro[1]!=$bandera//Aqui lo comprobamos si existen
                    
{
                        
$bandera=$registro[1]; 
                    
?>
                <table width="95%">
                    <tr bgcolor="#CCCCCC">
                        <td width="25%">
                                Opci&oacute;n <?php echo $bandera?>
                        </td>
                        <td width="25%">
                                Art&iacute;culo
                        </td>
                        <td width="25%">
                                Descripci&oacute;n
                        </td>
                        <td width="20%">
                                Cantidad
                        </td>
                  </tr>
                  </table>
                        <?php 
                       $mas
=0; } // el valor de mas condiciona si ponemos la imagen mas o no    
                    
                
if($mas==0// Si mas vale 0 no ponemos el mas pero si entra ponemos el mas en 1
                    
{
                    
?>
                    <table width="95%">
                    <tr>
                          <td width="25%">
                            <img src="http://www.forosdelweb.com/f18/images/productos/MINI/<?php echo $registro[5];?>" border="0"> 
                        </td>
                        <td width="25%" align="left">
                                
                                    <img src="images/pdf_button.png" border="0">  <?php echo $registro[2];?>
                             
                         </td>
                         
                        <td width="25%">
                                <?php echo $registro[3];?>
                        </td>
                        <td width="20%" align="left">
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $registro[4];?>
                        </td>
                            
                  </tr>
                        </table>
                        <?php  
                        $mas
=1
                    }

                else 
// Aqui mas es diferente de 0 osea 1 y ponemos la imagen
                    

                        
?>
                        <table width="95%">
                        <tr>
                        <td width="25%">
                    <img src="guia/images/mas_azul.jpg">
                    <img src="http://www.pagina.com/images/productos/MINI/<?php echo $registro[5];?>" border="0"> </td>
                    <td width="25%" align="left">
                    
                                    <img src="images/pdf_button.png" border="0"> <?php echo $registro[2];?>
                
                    </td>
                    <td width="25%">
                    <?php echo $registro[3];?>
                    </td>
                    <td width="20%" align="left">
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $registro[4];
                    
?> </td>
                    </tr>
                    </table>
                    <?php 
                    $mas
=1;
                    }
                }
                
?>