Ver Mensaje Individual
  #11 (permalink)  
Antiguo 04/04/2008, 15:18
hasc
 
Fecha de Ingreso: abril-2008
Mensajes: 14
Antigüedad: 16 años, 1 mes
Puntos: 0
Re: Ayuda Con Select en Php

Cita:
Iniciado por Nano_ Ver Mensaje
Saludos
Por que no lo haces todo dentro del mismo query
Código PHP:
$sql "select * from beneficios where rut = '".mysql_escape_string($_POST['caja1'])."'";
$sql mysql_query($sql) or die(mysql_error());
echo     
"<table width='700'  border='1' align='center' cellpadding='0' cellspacing='0' bordercolor='#999999'> \n";
echo     
"<td width='10%' bgcolor='BBBBBB'><b>FECHA:</b></td>";
echo     
"<td WIDTH='10%' bgcolor='BBBBBB'><b>SOLICIT&Oacute;:</b></td>";
echo     
"<td WIDTH='50%' bgcolor='BBBBBB'><b>OBSERVACIONES:</b></td>";
echo     
"<td WIDTH='20%' bgcolor='BBBBBB'><b>ESTADO:</b></td>";
echo     
"<td WIDTH='10%' bgcolor='BBBBBB'><b>ATENDIDO POR:</b></td>";
echo     
"</table>\n";
echo     
"<table width='700' height='30' border='1' align='center' cellpadding='0' cellspacing='0' bordercolor='#999999'> \n";
while(
$row mysql_fetch_array($sql)){
echo     
"<tr><td width='10%' height='30' style='vertical-align:top'>".$row['fecha']."</td>";
echo     
"<td width='10%' style='vertical-align:top'>".$row['solicita']."</td>";
echo     
"<td width='50%' style='vertical-align:top'>".$row['beneficio']."</td>";
echo     
"<td width='20%' style='vertical-align:top'>";
echo     
"<select name='estado'>";
$estado=$row['estado'];
echo     
"<option value=\"".$estado."\ selected>".$estado."</option>";
if(
$estado=="Pendiente"){
echo 
"<option value='Solucionado'>Solucionado</option>";
}
else if (
$estado=="Solucionado"){
echo 
"<option value='Pendiente'>Pendiente</option>";
}
echo     
"</select></td>"
echo     
"<td width='10%' style='vertical-align:top'>".$row['usuario']."</td>";
}
 
echo     
"</table>\n"
mmmmm.......... por ahi es el asunto
Gracias por tu tiempo NANO, pero ahora solo me muestra el primer registro de la fila beneficio y el ultimo de la fila estado, nose si me explico...