Ver Mensaje Individual
  #2 (permalink)  
Antiguo 16/01/2014, 09:33
Avatar de Patriarka
Patriarka
 
Fecha de Ingreso: enero-2011
Ubicación: Moreno, Buenos Aires, Argentina
Mensajes: 2.851
Antigüedad: 13 años, 3 meses
Puntos: 288
Respuesta: Select PHP MYSQL

Hola Amigo lo que pasa es no sabes de html basico ni de escapar html con php

Código PHP:
Ver original
  1. CODIGO 1
  2. <form action="actnot.php" method="post">
  3. <table>
  4. <tr>
  5. <td>CIA</td>
  6. <td>
  7. <?php
  8. $sql = "SELECT DISTINCT cia,nombre FROM ciasgeneral order by nombre asc";
  9. $res = mysqli_query($conn, $sql);
  10. [COLOR="Red"]echo"<select>";
  11. while($fila = mysqli_fetch_assoc($res)){;
  12. echo"<option name=".$fila['cia']." id=".$fila['cia']." selected='selected'>".$fila['nombre']."";
  13. }
  14. echo"</select>[/COLOR]
  15.  
  16. ?>
  17. <select name="ciasgeneral" id="ciasgeneral">
  18. while($fila = mysqli_fetch_assoc($res)){
  19.    <option value="<?php echo $fila['cia']; ?>"><?php echo $fila['nombre']; ?></option>
  20. }
  21. ?>
  22. </select>
  23. </td>
  24. </tr>
  25. <tr>
  26. <td>Fecha de Vencimiento</td>
  27. <td><input type='date' name='vto' id='vto'></td>
  28. <tr>
  29. <td>Noticia</td>
  30. <td><textarea rows='4' cols='50' name='noticia' id='noticia'></textarea></td>
  31. </tr>
  32. <tr>
  33. <td><button type='submit'>CARGAR</button></td>
  34. <td><button type='reset'>LIMPIAR</button></td>
  35. </tr>
  36. </table>
  37. </form>

primero proba que esto funcione ya que estabas armando MUY MAL el select