Ver Mensaje Individual
  #3 (permalink)  
Antiguo 14/12/2011, 08:46
martingb
 
Fecha de Ingreso: julio-2007
Mensajes: 15
Antigüedad: 16 años, 9 meses
Puntos: 0
Pregunta Respuesta: Mostrar estado en una página

En verdad no tira ningún error, solo que hace esto:


</tr>
<tr>
<td>Adobe Flash CS5</td>
<td>Freddy Camargo</td>
<td>Fox Andina</td>
<td>123456</td>
<td><img width="16" height="16" src="img/Prestado"></tb>
<td><input name="idLibro[]" type="checkbox" value="12" /></td>
</tr>
<tr>
<td>PHP 6</td>
<td>Weiro Meier</td>
<td>Fox Andina</td>
<td>312432</td>
<td><img width="16" height="16" src="img/Prestado"></tb>
<td><input name="idLibro[]" type="checkbox" value="13" /></td>
</tr>



Esta mostrado el mismo resultado para ambos registros, osea.. en base a la consulta que le paso... actualmente hay dos registros, el primer libro: Adobe Flash CS5 cuyo estado es "Disponible" y el segundo libro: PHP 6 que esta "Prestado"..


me falta seguramente lo sig.. que recorra la tabla, IF ( estado = 'Disponible' ) {
$dis = '<img width="16" height="16" src="img/green.png">' ; } else { $dis = '<img width="16" height="16" src="img/red.png">' ; }

el tema es ese

No se como armarlo dentro del While si deberia ser:

Código PHP:
Ver original
  1. while($row = mysql_fetch_array($rec)){
  2.  
  3.     IF ( $row["estado"] == 'Disponible' ){
  4.      
  5.         $dis = '<img width="16" height="16" src="img/green.png">' ;
  6.  
  7.   } else {
  8.  
  9.           $dis = '<img width="16" height="16" src="img/red.png">' ;
  10.     }
  11.      
  12. }