codeigniter is_unique数据库设置

Can someone assist me on the use of the is_unique function for form validation using codeigniter? Here is my code:

    $this->form_validation->set_rules('email', 'email', 'trim|valid_email|is_unique[users.email]');

How do I set users.email?

is_unique was added in CI 2.1.0. If you are using lower versions, then i suggest you look at this link: is_unique Codeigniter

Hope it helps

You must have a users table in your database, containing an email field.

<input name="email" /> 

must corrispond with you users table

`email varchar(128) not null unique`

then your rules, no params passed if NOT A CALLBACK!!

rules=>'trim|required|max_length[128]|valid_email|is_unique'