I managed to add a data from dropdown going to database. My problem is when I want to edit, I cant see the value from database that I add going to dropdown. I know that my problem lies in the edit_class_view.php file.
Here is my edit_class_view.php:
<div class="form-group"> <label class="control-label col-lg-2"> School Year-Semester:</label> <div class="col-lg-4"> <?php echo form_open('main/editClass'); $options = array( '' => 'Select School Year and Semester', 'SY 2016-2017 2nd Sem' => 'SY 2016-2017 2nd Sem', 'SY 2017 Summer' => 'SY 2017 Summer', 'SY 2017-2018 1st Sem' => 'SY 2017-2018 1st Sem', ); echo "<div class='drop_pos'>"; echo form_dropdown('sys', $options, 'class="btn dropdown-toggle"', 'required="required"', 'data-toggle="dropdown-menu"', '<?php echo $row->$School_Year_Semester;?>'); ?> <br> <div class="text-danger"><?php echo form_error('sys'); </div> </div> </div> </div>