Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A Database Error Occurred in codeigniter.

what is this error? How do I fix it?
i use of codeigniter.

A Database Error Occurred
Error Number: 1048

Column 'captcha_time' cannot be null

INSERT INTO `captcha` (`captcha_time`, `ip_address`, `word`) VALUES (NULL, '31.57.141.7', NULL)

Filename: /home/324/public_html/123/models/login_model.php

Line Number: 79

line 79:

function create_captcha()
    {
    $vals = array(
        'img_path'   => './captcha/',
        'img_url'    => 'captcha/',
    );
$cap = create_captcha($vals);
    $data = array(
    'captcha_time'  => $cap['time'],
    'ip_address'    => $this->input->ip_address(),
    'word'   => $cap['word']
    );
    $query = $this->db->insert_string('captcha', $data);
    $this->db->query($query); // this line 79
    }
like image 287
Julia Roberts Avatar asked Jul 02 '26 08:07

Julia Roberts


1 Answers

You're getting this error because the folder "/captcha" is either not on your server or has the wrong permissions set.

if the image path doesn't exist, or isn't writeable the create_captcha() function returns false, have a look in the captcha helper.

like image 100
matjkd Avatar answered Jul 04 '26 21:07

matjkd