[eluser]Unknown[/eluser]
I'm trying to use the captcha helper and following the instructions provided by CI docs.
But even the default example provided by CI seems to fail. I've also created the captcha table from the sql provided in the example.
Code:
$this->load->helper('captcha');
$vals = array(
'img_path' => './captcha/',
'img_url' => 'http://example.com/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);
Produces:
Error Number: 1048
Column 'captcha_time' cannot be null
INSERT INTO `captcha` (`captcha_time`, `ip_address`, `word`) VALUES (NULL, '127.0.0.1', NULL)
Filename: D:\ci\system\database\DB_driver.php
Line Number: 330