Error CodeIgniter Error accessing error

I created this registration form to register new users on a website using CodeIgniter. My problem is that whenever I enter a username that already exists in my database, instead of giving me my error message that explains this to the user, it instead gives me this error message:

Unable to access error message matching your field name

Here are the code snippets of my controller. Any help would be appreciated:

function register() { $this->load->library('form_validation'); $this->form_validation->set_rules( 'username', 'Username', 'trim|required|alpha_numeric|min_length[6]|xss_clean'. '|strtolower|callback_username_not_exists' ); // function body here } function username_not_exists($username) { $this->form_validation->set_message('username','That %s already exists.'); if($this->User_model->check_exists_username($username)) { return false; } else { return true; } } 
+6
php callback mysql codeigniter
source share

No one has answered this question yet.

See related questions:

1624
How do I get PHP errors?
1204
How to access the correct `this` inside a callback?
1065
Link. What does this error mean in PHP?
twenty
Codeigniter 3 Failed to access error message
5
How do I submit a post-method form to the same URL in another function in CodeIgniter?
0
Codeigniter field does not match required Html5 tag
0
CodeIgniter - Unable to access error message matching your field name
0
Codeigniter callback error
0
Preventing duplicate entries when inserting and updating using codeigniter

All Articles