इसे पसंद करें
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;
}
और html
. में<select name="office_name">
<?php echo selectdata(); ?>
</select>