Welcome Guest, Not a member yet? Register   Sign In
New is_unique form validation method NOT WORKING! [SOLVED]
#3

[eluser]jmc_1014[/eluser]
you should extends your library and not editing system folder

create a file MY_Form_validation.php in application\libraries

<?php

class MY_Form_validation extends CI_Form_validation{


function is_unique($str, $field)
{
list($table, $field) = explode('.', $field);

$this->CI->form_validation->set_message('is_unique','The %s is not available');

if (isset($this->CI->db))
{
$query = $this->CI->db->where($field, $str)->get($table);
return $query->num_rows() === 0;
}

return FALSE;
}

}

try it it works for me


Messages In This Thread
New is_unique form validation method NOT WORKING! [SOLVED] - by El Forum - 03-17-2012, 11:58 AM



Theme © iAndrew 2016 - Forum software by © MyBB