experts help me on this code.. |
[eluser]bujal[/eluser]
I would like to check if user exist in the database when creating new account. with this codes when I try to create user which is already exist in the database, the message user already exist doesn't appear. instead the flash message displayed saying that account is created. But nothing stored in the database.I m not sure where is the error. this is 1st time using codeigniter, appreciate help from experts..thanks How if I want to check both $nameStaf & $noStaf already exist?? Code: controller codes Code: class ModelUser extends CI_Model { Code: private function checkUser_exist($nameStaf)
[eluser]bujal[/eluser]
well, is this question too easy for u all since nobody replies ![]()
[eluser]sv3tli0[/eluser]
The best advice is to check the userguide of CI http://ellislab.com/codeigniter/user-guide/ In your case check the usage of the flashdata method ![]() http://ellislab.com/codeigniter/user-gui...sions.html You have to set "$this->session->flashdata('item');" inside your View to see the message which you have set (error or success) ![]() + you may use Form_validation to grab POST data and to check a field exists in your DB with is_unique check . http://ellislab.com/codeigniter/user-gui...ation.html |
Welcome Guest, Not a member yet? Register Sign In |