How to create an array and insert record in MySQL database using Codeigniter

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);

Leave a Reply

Your email address will not be published. Required fields are marked *