i have developed select box using php all work fine. but i want to display default word like SELECT instead of first item in selectbox, how can i do it.
<?php
if(!isset($_POST['floor_id']))
{
$fl = 'floor_id';
$_POST['floor_id'] = $fl;
}
$query = "SELECT id,floor from sdh_extension.tb_floor";
$selectbox='<select name="floor_id" class="form-control"
onchange="this.form.submit()">';
foreach ($db->query($query) as $row)
{
$id=$row['id'];
$name=$row['floor'];
if($row['id'] == $_POST['floor_id'])
{
$isSelected = ' selected="selected"';
}
else {
$isSelected = '';
}
$selectbox.= "
<optionvalue=".$id.$isSelected.">".$name."</option>";
}
$selectbox.='</select>';
echo $selectbox;
?>