Ver Mensaje Individual
  #5 (permalink)  
Antiguo 19/04/2007, 15:11
Avatar de GatorV
GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 18 años
Puntos: 2135
Re: Posicion inicial en un select

Código PHP:
<td width="70%"><select size="1" name="cat_id">
    <?
    $valor_preseleccionado 
$row['cat_id'];
    while (
$row2=mysql_fetch_array($resultado))
    {
     if( 
$row2['cat_id'] == $valor_preseleccionado ) {
         echo 
"<option value=$row2[cat_id] selected=\"selected\">$row2[cat_nom]</option>";             
     } else {
         echo 
"<option value=$row2[cat_id]>$row2[cat_nom]</option>";
     }
    }
    
?>
    </select>