Faites comme ça
function selectdata(){
$select="SELECT * FROM table_name";
$run=mysql_query($select);
$field_name = '';
while($fetch=mysql_fetch_array($run)){
$field_name.="<option value=''>" . $fetch['field_name'] . "</option>";
}
return $field_name;
}
Et en html
<select name="office_name">
<?php echo selectdata(); ?>
</select>