Udělejte to takto
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;
}
A v html
<select name="office_name">
<?php echo selectdata(); ?>
</select>