I am getting a specific row in a database with codeigniter / php /active record. I a would like to return the result as an array of the row's columns that can be referenced like this:
result[0] = column1
result[1] = column2
...
This is my current query:
public function get_instance($instanceID = NULL){
$this->db->select('organism, feature, goal');
$this->db->from('extra_instances');
$this->db->where('id', $instanceID);
$query = $this->db->get();
return $query->row_array();
}
$data['instance'] = $this->instances_model->get_instance($instanceID);
But currently, to echo these, I (think) I need to give the name of the column, like:
<?php echo($instance['goal']) ; ?>
Is there a way to do this so I can say:
<?php echo($instance[2]) ; ?>