@tressie.damore
To print each row value one by one in CodeIgniter, you can follow these steps:
1 2 3 4 |
public function getRows() { $query = $this->db->get('your_table_name'); return $query->result(); // Returns an array of objects representing each row } |
1 2 3 4 5 |
public function index() { $this->load->model('MyModel'); $data['rows'] = $this->MyModel->getRows(); $this->load->view('my_view', $data); } |
1 2 3 |
<?php foreach ($rows as $row): ?> <?php echo $row->name; ?><br> <?php endforeach; ?> |
This will print each row value one by one. Adjust the code according to your specific requirements, including the table name and the column you want to print.