I was wrote this function in my model :
public function get_writers()
{
$this->db->select('writer');
$query = $this->db->get('news');
return $query->result_array();
}
And I want to run a foreach
loop on result of this array in my view file :
<label for="writer">Writer</label>
<select name="writer" id="writer">
<?php foreach (??? as $each): ?>
<option value="<?php echo $each['id'] ?>"><?php echo $each['writer'] ?></option>
<?php endforeach; ?>
</select>
But I don't know what should I write in the first parameter in foreach
loop.Can anybody help me with this ?
Thanks