Login Validation - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Login Validation (/showthread.php?tid=6654) |
Login Validation - El Forum - 03-06-2008 [eluser]SparkyCola[/eluser] Hi, I'm a bit stuck. In PHP, this is what I want to do, just as a rough idea: Code: $query = "SELECT * FROM users WHERE username='$user_name' AND password='$password'"; In CI this is what I have: Code: function _validation($user_name, $password) { I'd appreciate any help, just not sure how to achieve the same result - i.e. checking the username AND password together. I could do a callback thing with password as well, but I don't want to do that in case the username is in the database, and the password is in the DB too, but not together on the same row. Thanks, Sparky Login Validation - El Forum - 03-06-2008 [eluser]James Gifford[/eluser] There are any number of ways to do validation that depend a lot on your preferred coding style. Here is a simple way: Code: function login () Login Validation - El Forum - 03-06-2008 [eluser]SparkyCola[/eluser] Ah I see- thanks very much James Sparky |