Log in

View Full Version : can i do this



zee000
02-09-2010, 12:57 PM
hiiiiiii

i am creating an register page i have set that login name and mailid should be different for users to provide that i have set login name and mailid fields to unique.... now what i need is how can i check this using php.....


any suggestions plzzzzzz

Nile
02-09-2010, 01:17 PM
You want to make sure login name doesnt equal the mailid field?


if($login_n == $mail_id){
echo "Its not unique...";
}

zee000
02-09-2010, 01:34 PM
no what i said is same login name should not be used by the another user

djr33
02-09-2010, 04:43 PM
1. Store info in a database (or text files if you can't use a database).
2. When someone new registers, be sure that the info does not already exist in the database: make sure that searching for that email (or anything) returns false.
3. Ask them to use another email if it did exist; if not, continue.

zee000
02-10-2010, 05:18 AM
I have already set to unique for that fields in database now my question is now i need to check that fields in my php coading how can i do that

djr33
02-10-2010, 07:05 AM
Try to find the email address in the database. If the query returns no results, the email is unique. If you find a match, it is not unique.