database interaction in codeigniter

Solutions on MaxInterview for database interaction in codeigniter by the best coders in the world

showing results for - "database interaction in codeigniter"
Mia
09 Sep 2019
1<?php
2defined('BASEPATH') OR exit('No direct script access allowed');
3class ActiveRecordController extends CI_Controller {
4    public function store_order(){
5        $data = [
6            'date' => '2018-12-19',
7            'customer_name' => 'Joe Thomas',
8            'customer_address' => 'US'
9        ];
10
11        
12        $this->db->insert('orders', $data); 
13
14        echo 'order has successfully been created';
15    }
16}
17
Emelie
01 Sep 2017
1$route['ar/insert'] = 'activerecordcontroller/store_order';