Ver Mensaje Individual
  #5 (permalink)  
Antiguo 29/12/2013, 20:42
edward1994
 
Fecha de Ingreso: junio-2013
Ubicación: En cualquier parte de mi casa
Mensajes: 139
Antigüedad: 10 años, 11 meses
Puntos: 14
Respuesta: Como hacer que si una fila de base de datos es igual a un valor que algo s

Código PHP:
Ver original
  1. <div id="información">
  2.         <h2>Colores disponibles </h2>
  3.         <?php
  4.         if ($color1 == "gris" ){
  5.             echo'<img src="imagenes/1.jpg" alt="" width="40px" height="40px" title=" '.$color1.'" style="margin-right:10px; margin-left:10px;"  />';
  6.                
  7.            
  8.            }
  9.         if ($color1 == "azul" ){
  10.             echo '<img src="imagenes/2.jpg" alt="" width="40px" height="40px" title=" '.$color1.'" style="margin-right:10px; margin-left:10px;" />';
  11.                
  12.            
  13.            }
  14.            
  15.         if ($color1 == "rojo" ){
  16.             echo '<img src="imagenes/3.jpg" alt="" width="40px" height="40px" title=" '.$color1.'" style="margin-right:10px; margin-left:10px;" />';
  17.                
  18.            
  19.             }
  20.         if ($color1 == "amarillo" ){
  21.             echo '<img src="imagenes/4.jpg" alt="" width="40px" height="40px" title=" '.$color1.'" style="margin-right:10px; margin-left:10px;" />';
  22.          
  23.            
  24.             }
  25.        
  26.    
  27.     ?>
  28.    
  29.     </div>
Prueba asi! e investiga sobre la estructura de If en PHP