I'm new in PHP and Codeigniter. I need help to search with dropdown and submit. I retrieve dropdown values from MySQL, and now I need to choose samo value from dropdown, click on submit and filter results(on same page I retrieve some data, which I want to filter by value with this search). This is my search form, and I need your help to create controller and model for this search.
Updated: I''ll try to explain better.. There is a code for my search form.. In select box I retrieve values from MySQL. On same page, I also retrieve some data from MySQL. Now I want to filter this data with search form. Example:If I choose country (job_publish_country), Greece,and click on submit I want to filter data with job_publish_country Greece. I mentioned that I already have in this page sme data, and that data have job_publish_country(Greece, Italy, etc.).With this form, I want to filter it. If I choese Greece, just display data with Greece, and data with some other country hide.I need help to write controller and model, AJAX (if it's need) for this.If you can help me, tnx a lot.
<?php echo form_open('')?>
<div class="form-group">
<label for="country_select" class="form_label">
<?php echo lang('jobs_text_3');?></label>
<select class="form-control" id="country_select">
<option value=""><?php echo lang('jobs_text_6');?></option>
<?php foreach ($countries as $country){?>
<option value="<?php echo $country->job_publish_country;?>" id=" <?php echo $country->job_publish_country;?>"><?php echo $country->job_publish_country;?></option>
<?php }?>
</select>
</div>
<input type="submit" class="search-btn" name="country_submit" id="country_submit" value="<?php echo lang('jobs_text_9');?>">
<?php echo form_close();?>