小编Jul*_*rts的帖子

codeigniter中发生数据库错误.

这个错误是什么?我如何解决它?
我使用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
Run Code Online (Sandbox Code Playgroud)

第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
    }
Run Code Online (Sandbox Code Playgroud)

php captcha codeigniter

3
推荐指数
1
解决办法
7017
查看次数

标签 统计

captcha ×1

codeigniter ×1

php ×1