My problem is when an option selected it works fine but when it is not selected it shows error "Undefined index: keyword"
How can i select an default value for selected option ?
How to not show error even if no option is selected ? just insert empty in database
or
simply how to prevent that error if nothing is selected ?
<select class="selectpicker btn btn-warning " name="keyword" style="font-size:17;">
<option disabled="disabled" selected="selected" style="display:none; ">SELECT TOPIC</option>
<option >Anime</option>
<option >WTF</option>
<option >Did you know</option>
</select>
<?php if(isset($_POST['sub'])){
$post_keywords = $_POST['keyword'];
}
?>