I just what to turn the result array from my query (which is only has one column) to a unique array so it doesnt have repeated elements.
I don't know what else to do, I've tried everything, what am I doing wrong?
Model:
public function get_info()
{
$this->db->select('column');
$this->db->from('table');
$query=$this->db->get()->result_array();
$out=array_unique($query);
return $out;
}
Controller:
public function index()
{
$this->load->model('the_model');
$data['stuff']=$this->the_model->get_info();
$this->load->view('the_view',$data);
}
View:
<?php
foreach($stuff as $i)
{
echo "$i['column']}";
}
?>
The error I get is this:
A PHP Error was encountered
Severity: Notice
Message: Array to string conversion
Filename: models/the_model.php