I'm developing a drop-down form with values from a database. My question is how can I display values from the database to the drop-down without displaying the same values. I have 2 data in my database which consist of the same value (Paid) but when I display it on my dropdown it shows 2 "Paid" values instead of one.
Thank you
Here is my Model :
public function getLiveEvents(){
$query = $this->db->get('live_events');
return $query->result();
}
Here is my View :
<label class="control-label" for="name">Ticket type:</label>
<select name="type" class="form-control input-md">
<?php
foreach ($sort as $sorts) {
echo '<option value="' . $sorts->live_type . '">' . $sorts->live_type.'</option>';
}
?>
</select>