Ver Mensaje Individual
  #6 (permalink)  
Antiguo 26/05/2014, 12:42
portal47
 
Fecha de Ingreso: abril-2014
Mensajes: 141
Antigüedad: 10 años
Puntos: 1
Respuesta: selección combo box

lo intente asi:

Código PHP:
Ver original
  1. <td height="44">
  2.      
  3. <?php
  4.       $result = mysql_query("SELECT * FROM dir_titulo ORDER BY titulo ASC");
  5. ?>
  6.       Titulo:
  7.      
  8. <select name="titulo" style="width: 300px;">
  9. <?php
  10. while($row = mysql_fetch_array($result)) {
  11.  
  12. $valor = $row["id_titulo"] ;
  13. $nom = $row["titulo"];
  14. $sel = ($valor_actual == $row["id_titulo"]) ? ' selected="selected"' : '';
  15. echo "<option selected=".$sel." value=".$valor." >".$nom."</option>";
  16. }