Hi i m new with codeigniter Kindly help me how i display data in dropbox from database and save into datbase.

Hi,
As per my understanding you need so show data in dropdown (In view file) i.e. showing country list in from.
Ex: Showing Country list in dropdown
A) Create a model to fetch all data from "countrymaster" table
-- Controller --
$data = array();
$data['countrylist'] = $this->localizationmodel->getCountryList();
// I asume that you are created model localizationmodel
// Pass data to view file
$this->load->view('myform', $data);

-- View file --
<select class="form-control" name="country_id" id="city_h" style="width:100%;" >
<?php foreach( $countrylist as $key=>$val): ?>
<option value="<?php echo $val->countrymaster_id; ?>" ><?php echo $val->country_name; ?></option>
<?php endforeach; ?>
</select>

Note: You need to create a table i.e. country_master which is having fields like countrymaster_id, country_name etc.

Please check and let me know.

Thanks,
Ajay

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.