Welcome Guest, Not a member yet? Register   Sign In
How does is_unique[...] work?

(This post was last modified: 09-16-2018, 04:49 AM by Serializable.)

PHP Code:

Could you explain how is_unique work? What is 'users'? The controller which contains the above code named Users, so is 'users' related to the controler name? Next, what is '.username' here? How does it work?

The answer to your question is in the documentation about the form_validation library:

is_unique[table.field] returns FALSE if the form element is not unique to the table and field name in the parameter. Note: This rule requires Query Builder to be enabled in order to work.

So users is the table, username is the field.


How can I check is Query Builder enabled for my project?

It's enabled by default.


Wouter60, thanks

Theme © iAndrew 2016 - Forum software by © MyBB