April 25th, 2013, 11:40 AM
Check user in database
HY to every one!
i want that when a user enter his name or any other data, then the data is checked in database and if it is already exists then it will show an error message, else it will save the data..
what type of function/method i used here...
if any one have any idea then plz share it...
April 25th, 2013, 12:17 PM
If it already exists then show an error message, otherwise save the data.
It's exactly like you said. Try just writing the code for it.
April 25th, 2013, 12:33 PM
You COULD check the database first.
Or you could put a UNIQUE constraint on the relevant columns, and handle a constraint violation as the error you're talking about.
HEY! YOU! Read the New User Guide and Forum Rules
"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin
"The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002
Think we're being rude? Maybe you asked a bad question
or you're a Help Vampire.
Trying to argue intelligently? Please read this.