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

[eluser]miauksius[/eluser]
Howdy,

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.

THANK YOU

P.S. Sorry for the broken english
#2

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

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

[eluser]miauksius[/eluser]
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
#4

[eluser]mimran[/eluser]
HI
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
#5

[eluser]miauksius[/eluser]
Yes yes yes, I understand that, but how should the query look like, and how can I handle it?
#6

[eluser]miauksius[/eluser]
Problem solved




Theme © iAndrew 2016 - Forum software by © MyBB