Welcome Guest, Not a member yet? Register   Sign In
how to check is the username available?


When I was programing regular PHP, I was storing all data to txt files, and now, when I'm starting to use CI, I must use mysql. Can you please tell me, how to check username availability? That would help me to create the callback function for form validation.


P.S. Sorry for the broken english

[quote author="miauksius" date="1248631713"]
now, when I'm starting to use CI, I must use mysql.

You mean you are required to use MySQL because of CodeIgniter or because of someone (or something) else?

Because sooner or later I would have to use mysql, and CI was the reason to start that sooner. Besides, it's so easy with CI Smile

I guess simplest logic is you will be storing a username in a user table. So when someone is signing up and they ask for a username just check against all the usernames' in the table you already have, if it is not there that means it is available.

good luck

Yes yes yes, I understand that, but how should the query look like, and how can I handle it?

Problem solved

Theme © iAndrew 2016 - Forum software by © MyBB