I'm new to CodeIgniter. I love it, it's great, but one issue cannot resolve for days.
I'm trying to get a single row, by its id, like this :
$query = $this->db->get_where('content', ['id' => $id]);
$the_content = $query->result_array();
However, it results in an array of size 1, like this:
$the_content = [ 0 => ['id' => 1, 'content'=> 'abc']];
so I always have to convert it to its first element like this:
$the_content= $the_content[0];
But you can understand why I don't like this.
I also tried $query->result(); , still the same.
I'm sure I'm missing a simple point here, but what?
How do I get single element from ActiveRecord instead of array?