[eluser]nabin das[/eluser]
Controller:-
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Test_controller extends CI_Controller{
function __construct() {
parent::__construct();
$this->load->model('test_model', '', true);
}
public function index(){
$this->load->view('test_view');
}
public function inserts(){
$this->form_validation->set_rules('id', 'ID', 'trim|required');
$this->form_validatoin->set_rules('deskripsi', 'DESKRIPSI', 'trim|required');
$this->text_model->insert();
}
}
?>
Model:-
class Test_model extends CI_Model{
public function insert(){
$this->load->helper('url');
}
}
$data = array(
'id' => $this->input->post('id'),
'deskripsi' => $this->input->post('deskripsi')
);
return $this->db->insert('table_name', $data);
try with this. hope it will work fine