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

Cita:
Iniciado por jovendigital Ver Mensaje
a ver, sino me equivoco necesitas esto:
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"; 
while(
$row = mysql_fetch_array($sql)){ 
echo     
"<table width='700' height='30' border='1' align='center' cellpadding='0' cellspacing='0' bordercolor='#999999'>"; 
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'>"; 
$estado=$row['estado']; 
if(
$estado=="Pendiente"){ 
echo 
"<select name='estado'>"; 
echo 
"<option value=$estado selected>$estado</option>"; 
echo 
"<option value='Solucionado'>Solucionado</option>"; 
echo 
"</select>"; 
} 
if(
$estado=="Solucionado"){ 
echo 
"<select name='estado'>"; 
echo 
"<option value=$estado selected>$estado</option>"; 
echo 
"<option value='Pendiente'>Pendiente</option>"; 
echo 
"</select>"; 
} 
echo     
"</td><td width='10%' style='vertical-align:top'>".$row['usuario']."</td>"; 
echo 
"</tr>";
echo     
"</table>\n"; 
} 
Asi me resulta muchas gracias compadre.. te las mandaste, gracias a los demas igual