Everytime I insert an image to database i got this error
Error Number: 1452
Cannot add or update a child row: a foreign key constraint fails (
herbalcebu.product, CONSTRAINTproduct_ibfk_1FOREIGN KEY (categorie_id) REFERENCEScategorie(categorie_id))INSERT INTO
product(product_image) VALUES ('q3.jpg')Filename: C:/xampp/htdocs/HerbalCebu/system/database/DB_driver.php
Line Number: 691
This is my Controller Code
public function insert_product()
{
        $this->form_validation->set_rules('product_name','Productname','required');
        $this->form_validation->set_rules('product_price','Amount','required');
        $this->form_validation->set_rules('product_stock','Stock','required');
        $this->form_validation->set_rules('categorie_id','categorie_id','required');
        $this->form_validation->set_rules('product_description','Description','required');
     $config = array
        (
            'upload_path' => './assets/img',
            'allowed_types' => 'jpg|png|jpeg|bmp',
            'max_size'=> 0,
            'filename' => $_FILES['product_image']['name']
    );
    $this->load->library('upload',$config);
    if($this->upload->do_upload('product_image'))
    {
        $uploaddata  = $this->upload->data();
        $product_image=$uploaddata['file_name'];
        $this->db->insert('product',array('product_image'=>$this->upload->file_name));
    }
    if ($this->form_validation->run()) 
    {
        $data = $this->input->post();
        unset($data['submit']);
        $this->load->model('queries_product');  
        if($this->queries_product->insert_product($data))
        {
            $this->session->set_flashdata('msg','Successfully Inserted');
        }
        else
        {
            $this->session->set_flashdata('msg','Failed to Insert');
        }
        return redirect('inventory');
    }
    else
    {
        echo validation_errors ();
    }
}
My Model Code
public function insert_product($data)
    {   
        return $this->db->insert('product',$data);
    }
 
     
    