Ver Mensaje Individual
  #14 (permalink)  
Antiguo 04/04/2008, 15:54
jovendigital
 
Fecha de Ingreso: noviembre-2005
Mensajes: 222
Antigüedad: 18 años, 5 meses
Puntos: 2
Re: Ayuda Con Select en Php

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"