471,895 Members | 2,120 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,895 software developers and data experts.

Username validation against db

Hey. I am using mysql, php, and javascript (jquery).

I have a nice form setup where the username field validates AJAX-style against my database... this technique allows for the user to see if his username is already in use, while he is typing.

Problem is, I am only validating against the the exact (case-sensitive) value returned from the database. I want to make sure there can't be a user 'pete' and 'Pete'.

Any suggestions would be appreciated. ATTN: Moderators, this post may belong in either PHP or MySQL... I don't know if there is a fancy select statement I could use, or php method to compare against.

Apr 11 '09 #1
3 1402
....i could ignore capitalization to begin with...?
Apr 11 '09 #2
sorry...been up too late. strtolower() will work.
Apr 11 '09 #3
8,658 Expert Mod 8TB
that depends on your DB settings. just in case, there are uppercase and lowercase functions both in PHP and SQL.

you could also make a trial... (you know what users are already in the DB)
Apr 11 '09 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

21 posts views Thread by Stefan Richter | last post: by
67 posts views Thread by Scott Meyers | last post: by
2 posts views Thread by Sudip Chakraborty | last post: by
15 posts views Thread by Eugene Anthony | last post: by
6 posts views Thread by lists | last post: by
24 posts views Thread by runway27 | last post: by
1 post views Thread by hrishy | last post: by
reply views Thread by YellowAndGreen | last post: by
reply views Thread by zermasroor | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.