Re: Newbie database question
| From: | Richard Crawford | Date: | Sun, 13 Jan 2002 18:57:31 +0000 |
| Subject: | Re: Newbie database question | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-80364@lists.php.net to get a copy of this message | ||
I don't think that there's an easy way to do it in MySQL. I usually use some hack along the lines of, "select x from t where x = $y", and if there are any results returned, return a message of some sort ("That value already exists in the database!").
Bear in mind that sometimes people have very similar contact information. At the university where I used to work, there were two employees who shared the same first, middle, and last names, as well as birth dates, and their social security numbers differed by exactly one digit. A rare circumstance, to be sure, but not impossible.
Dean Ouellette wrote:
MySql At 10:10 AM 1/13/2002 -0800, Richard Crawford wrote:-- Sliante, Richard S. Crawford mailto:rscrawford@mossroot.com http://www.mossroot.com AIM: Buffalo2K ICQ: 11646404 Yahoo!: rscrawford MSN: underpope@hotmail.com "When you have lost the ability to laugh at yourself, you have lost the ability to think straight." --Clarence Darrow "Push the button, Max!"Which database are you using? Dean Ouellette wrote:I am entering info from form into database, is there a way to check say firstname, lastname and address to see if it is a duplicate to what is already in database and if it is then just enter any new information they may enter and not create a new entry-- Sliante, Richard S. Crawford mailto:rscrawford@mossroot.com http://www.mossroot.com AIM: Buffalo2K ICQ: 11646404 Yahoo!: rscrawford MSN: underpope@hotmail.com "When you have lost the ability to laugh at yourself, you have lost the ability to think straight." --Clarence Darrow "Push the button, Max!" -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net