<? $i=1; while ($fila=mysql_fetch_object($result2)) { ?><option value="<? echo $fila->$i; ?>"><? echo $fila->categoria; ?></option><? $i++; } ?>