How to create array and insert record in mysql database using Codeigniter

0

I’ll share to you very basic tutorial with codeignter,here is inserting data toyou database.Oke make it simple,first of all you must create a table in your database obviously after create form and save create array and save data in database table. You may also like How to Add, Edit and Delete Records Using jQuery, Ajax, PHP and MySQL and How to Delete Multiple Records From MySQL Using PHP.

Code

$data = array(
    'years_of_exp' => $this->input->post('years_of_exp'),
    'driver' => $this->input->post('driver'),
    'licence' => $this->input->post('licence'),
    );
$this->db->insert('candidates',$data);