y bueno estas poniendo todo junto, hace esto:
Código PHP:
Ver original<select name="unmane">
<?php
<? if( $fila['PADRE'] == 'Ingreso'){
$INGRESO = ' <option value="3"><?php echo $fila->TDOC_NOMB; ?></option>';
} ?>
<?php if( $fila['PADRE'] == 'Egreso'){
$EGRESO = ' <option value="3"><?php echo $fila->TDOC_NOMB; ?></option>';
} ?>
<?php } ?>
<optgroup label='Ingreso'>
<?php echo $INGRESO; ?>
</optgroup>
<optgroup label='Egreso'>
<?php echo $EGRESO; ?>
</optgroup>
</select>