Is there a mod to keep duplicates from a feild inside of a database? I have a lot of people entering in information and some of it is overlapping.
Jul 7, 2000, 12:48 AM
Veteran / Moderator (8669 posts)
Jul 7, 2000, 12:48 AM
Post #2 of 12
Views: 2518
The only check for duplication is of the key field. You can build in other checks for duplicates, but they will have to be on a field by field basis. What fields do you want to check?
JPD
http://www.jpdeni.com/dbman/
JPD
http://www.jpdeni.com/dbman/
I would like to have the second field in two of them, called factions, and the second field in the other called systems. Also a name field in one of them.
I have three right now, soon to be 5 databases, and im working on the relationships right now. If you need more info please tell me, i would love to get this up and running
I have three right now, soon to be 5 databases, and im working on the relationships right now. If you need more info please tell me, i would love to get this up and running
Jul 7, 2000, 9:38 AM
Veteran / Moderator (3034 posts)
Jul 7, 2000, 9:38 AM
Post #4 of 12
Views: 2507
Here are a few threads which provide solutions:
Check for duplicate records (multiple)
http://www.gossamer-threads.com/perl/forum/showthreaded.pl?Cat=&Board=DBInst&Number=57420&Search=true&Forum=DBInst&Words=Check for duplicate record&Match=Entire Phrase&Searchpage=0&Limit=25&Old=allposts
Check another field for duplicates
Thead reference:
http://www.gossamer-threads.com/scripts/forum/resources/Forum12/HTML/002388.html
These are also both referenced at the FAQ below. I think there may be one of two others within the same topic.
Hope this helps
Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/
Check for duplicate records (multiple)
http://www.gossamer-threads.com/perl/forum/showthreaded.pl?Cat=&Board=DBInst&Number=57420&Search=true&Forum=DBInst&Words=Check for duplicate record&Match=Entire Phrase&Searchpage=0&Limit=25&Old=allposts
Check another field for duplicates
Thead reference:
http://www.gossamer-threads.com/scripts/forum/resources/Forum12/HTML/002388.html
These are also both referenced at the FAQ below. I think there may be one of two others within the same topic.
Hope this helps
Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/
Jul 8, 2000, 11:02 PM
Veteran / Moderator (8669 posts)
Jul 8, 2000, 11:02 PM
Post #6 of 12
Views: 2477
The only way to do this is to make it specific to your databases.
You need to tell me the name of the .cfg file for each database and which fields you need to check for each one.
JPD
http://www.jpdeni.com/dbman/
You need to tell me the name of the .cfg file for each database and which fields you need to check for each one.
JPD
http://www.jpdeni.com/dbman/
Jul 9, 2000, 1:26 AM
Veteran / Moderator (8669 posts)
Jul 9, 2000, 1:26 AM
Post #8 of 12
Views: 2464
If they're both field number one, it's a lot easier.
In sub validate_record, after
if ($data[$db_key_pos] eq $in{$db_key}) {
return "duplicate key error";
}
add
if (($db_setup eq '1yb') or ($db_setup eq '666')) {
if ($data[1] eq $in{$db_cols[1]}) {
return "duplicate entry";
}
}
JPD
http://www.jpdeni.com/dbman/
In sub validate_record, after
Code:
if ($data[$db_key_pos] eq $in{$db_key}) {
return "duplicate key error";
}
Code:
if (($db_setup eq '1yb') or ($db_setup eq '666')) {
if ($data[1] eq $in{$db_cols[1]}) {
return "duplicate entry";
}
}
JPD
http://www.jpdeni.com/dbman/
Jul 12, 2000, 7:53 AM
Veteran / Moderator (8669 posts)
Jul 12, 2000, 7:53 AM
Post #10 of 12
Views: 2442
The names of the fields are different, but their position is the same, right? Therefore I can use $db_cols[1] to refer to either one. Or I should be able to, if your fields are numbered correctly.
I'll tell you what. Let's start with one of them. If we can get it to work, we'll go on to the next one.
if ($db_setup eq '1yb') {
if ($data[1] eq $in{Your field name) {
return "duplicate entry";
}
}
Are these both required fields?
JPD
http://www.jpdeni.com/dbman/
I'll tell you what. Let's start with one of them. If we can get it to work, we'll go on to the next one.
Code:
if ($db_setup eq '1yb') {
if ($data[1] eq $in{Your field name) {
return "duplicate entry";
}
}
JPD
http://www.jpdeni.com/dbman/
Jul 12, 2000, 3:46 PM
User (62 posts)
Jul 12, 2000, 3:46 PM
Post #11 of 12
Views: 2426
ok, did that and now i have both working, so i will attemtpt to add the other databases and see if that works. thanks a lot. on..on the validate thing...got it too, i missed a per_admin in there somwhere....*shrugs* oh well, but now it works. Im high maintence...my girlfriend tells me that all the time