CodeIgniter Registration Form Part 5
Loading...
10,268
Loading...
Uploader Comments (Verbloten)
see all
All Comments (16)
-
$result = $this->db->query($query, $username);
return ($result->num_rows() > 0) ? true : false;
-
Why work with if .. else .. statements in check_exists_username? Something like this seems more logical to me:
[code]
function check_exists_username($usernam
e){ $query_str = "blah"; $result = blah; if ($result->num_rows() == 0) return true; return false; }
[/code]
-
Nicely done!
-
@Verbloten Oh wow..i didnt know it was that easy to extend the functionality of CI
Thanks alot for your quick response!
-
Another excellent video. I learned a hell of a lot. Thanks very much!
Loading...
'username_not_exists' - pahaha.
Alasdair I think I love you.
ldexterldesign 7 months ago
@ldexterldesign ok? I love you too?
Verbloten 7 months ago
is there a rule to achieve the behaviour opposite to "match"...for example suppose you dont want a username to be the same as your password (for security reasons), hence you would need an validation error to be thrown if both values equal.
Is there a built in rule for that or would I have to write my own callback?
THanks.
mystiknrg 1 year ago
Verbloten 1 year ago
@Verbloten
somewhere near function matches.
Then in your form rules simply say not_matches[username] for the password field
Verbloten 1 year ago