Ver Mensaje Individual
  #2 (permalink)  
Antiguo 28/11/2005, 15:51
Avatar de Seppo
Seppo
 
Fecha de Ingreso: marzo-2005
Ubicación: Buenos Aires, Argentina
Mensajes: 1.284
Antigüedad: 19 años, 1 mes
Puntos: 17
¿Cómo perdón por no saludar, si saludaste ;)?

Código PHP:
<?
$select_data 
mysql_db_query('my_db'"SELECT category FROM theTable WHERE id='1'")
or 
trigger_error(mysql_error(),E_USER_ERROR);
$data mysql_fetch_assoc($select_data);
$options explode(",",$data);
?>
 <select name="category[]" multiple="muliple" rows="3">
  <option value="1"<?php if (in_array("1",$options)) { echo " selected=\"selected\""; } ?>>Acción</option>
  <option value="2" <?php if (in_array("2",$options)) { echo " selected=\"selected\""; } ?>>Ciencia Ficción</option>
  <option value="3"<?php if (in_array("3",$options)) { echo " selected=\"selected\""; } ?>>Aventura</option>
  <option value="4"<?php if (in_array("4",$options)) { echo " selected=\"selected\""; } ?>>Drama</option>
  <option value="5"<?php if (in_array("5",$options)) { echo " selected=\"selected\""; } ?>>Infantil</option>
  <option value="6"<?php if (in_array("6",$options)) { echo " selected=\"selected\""; } ?>>Clásica</option>
 </select>