Database Error |
Greetings All,
Am less than a month old in learning CI, I have a problem: I'm using the form_validation library to validate form inputs. Two of the fields (username and email fields) has to check in the DB that the user input is unique and doesn't already exist in the DB - I'm creating a user system using ion_auth. The code for the validation of the fields are as follows PHP Code: $this->form_validation->set_rules('name', 'Display Name', 'is_unique|isme_users.username|required'); I'm getting the error in the attached picture. I'm running LAMPP on Ubuntu and my server parameters are as follows (from PHPMyAdmin)
Help is needed and appreciated.
You need to put the table inside brackets.
https://www.codeigniter.com/userguide3/l...-reference PHP Code: $this->form_validation->set_rules('name', 'Display Name', 'required|is_unique[isme_users.username]'); (01-20-2018, 01:43 PM)jreklund Wrote: You need to put the table inside brackets.Thank you, that helped. Please, how can I edit the errors displayed? The picture below shows the error displayed when I provide an already taken email. I would like to display something like: "The Email has already been taken". Edit Found it, edited the form_validation language file.
I recommend that you do it this way, in case you overwrote the system language file.
https://www.codeigniter.com/userguide3/l...r-messages (01-21-2018, 02:23 PM)jreklund Wrote: I recommend that you do it this way, in case you overwrote the system language file. Thank you for the recommendation. |
Welcome Guest, Not a member yet? Register Sign In |