Check if exist in database |
[eluser]Casperlarsen94[/eluser]
Hi everyone! I'm quite new in Codeigniter but i'm trying to learn it. I have a register form, but i would like to check in the database before it goes to insert in my table. I hope you can help me. Register Controller Code: <?php Register Model Code: <?php I really hope that someone can explain it to me Thanks.
[eluser]Fireclave[/eluser]
you can write your callback function in your Validation as rule (http://ellislab.com/codeigniter/user-gui...#callbacks) or you can write a function in the model like $this->register_model->check_available() and you can check the name or/and the email. You are welcome
[eluser]smilie[/eluser]
Hi, In your model: Code: <?php Cheers, Smilie
[eluser]Fireclave[/eluser]
You can use librarys like http://codeigniter.com/wiki/Ion_Auth_-_L...th_System/ This is very nice and helps you with login, regist, logout, forgotten password, etc. try this out ;-) |
Welcome Guest, Not a member yet? Register Sign In |