[eluser]Bankzilla[/eluser]
[quote author="ojcarga" date="1349019614"][quote author="razorsese" date="1349002467"]
The problem is when someone register it doesn't check if that name already exist in database.
[/quote]
Are you just telling us what your application does not do or are you asking something??[/quote]
Instead of being a dick you could of just easily suggested a solution.
The database library has something built in that you aren't taking advantage of yet.
This will go the end of your validation rule and can go in replace of your callback function.
Code:
$this->form_validation->set_rules('username', 'Username', 'trim|required|min_length[5]|max_length[12]|is_unique[user.id]|xss_clean');