1

It only shows one data in a single cell. But all i want is to loop it to display all the data in my database

Here is a piece of my Code in Controller.

function firstDebit(){
$series=$this->uri->segment(3); 
$this->jevReport_model->getfirstDebit($series);
$data['accountNames']=$this->jevReport_model->getfirstDebit($series);
$accountName=$data['accountNames']['accountName'];

$this->excel->setCellValue('b10',$accountName);

}

Model

function getfirstDebit($series) {
$this->db->select ( 'accountcode.accountName' );
$this->db->from ( 'accountcode' );
$this->db->join ( 'generalaccount ', 'generalaccount.AccountCode = accountcode.id');
$this->db->where ( 'generalaccount.Series', $series);
$this->db->where ( 'generalaccount.Account', 'debit');
$this->db->where ( 'generalaccount.Count', 1);
$query = $this->db->get();
return $query->row_array ();

}

here is the output of my code enter image description here

but what i want is like this

enter image description here

I really need help. Thank you.

Irene
  • 137
  • 2
  • 14

0 Answers0