2012-02-13 71 views
0

我使用的版本:2.1.0,我有以下問題,當我在我的form_validation函數中使用is_unique:is_unique笨問題

$this->form_validation->set_rules('userName', 'User Name', 'trim|required|is_unique["users.userName"]|xss_clean|'); 

我收到以下錯誤:

enter image description here

但我的表結構是正確的,該DB連接:

enter image description here

+1

看起來像人們提供了合法的答案。我看到一個小問題(CI可能會清理......),但也要殺掉規則字符串中的最後一個條(|)。 – 2012-02-13 07:49:38

回答

2

你的表名是錯誤的。你正在查詢「用戶表,而不是由is_unique [」users.userName「]使用is_unique [users.userName]引起的用戶,而不是用戶名。