PDA

View Full Version : Database Duplicate Check


chris999
03-10-2003, 08:07 PM
Hi All
I have a problem where after the user has entered for example a new instructor name and I wish to do a data base check to see that the instructor name doesn't already exist.
Could somebody please suggest a way of doing a client side test. I have no desire to go to another screen then have to return and redisplay the data if there is a duplicate entered. Especially if I have a complicated screen with WDDX packets.

Cheers
Chris

arnyinc
03-10-2003, 09:29 PM
The most immediate way that I can think of doing this is to select all the names and read them into an array on that page. Then check to see if the user input matches anything in the array.

beetle
03-10-2003, 09:32 PM
If you have a small number of users, checking this client-side is feasable. Otherwise, stick to the tradtional method and send the user through the full authentication process.

chris999
03-11-2003, 01:54 AM
What do you mean the usual authentication process?? Does that mean going to the next screen and then returning if a duplicate is found?
I tried iframes but we are using IE5.5 and the user had to push the send button twice. The first time round nothing happened. The second time it worked.

Cheers
Chris

beetle
03-11-2003, 04:23 AM
yes, I mean allow the server-side code to check the db for duplicitous entries and notify the user if found.