If it is possible to setup that DBMan will not creat the same "Title" name for the user info if thers is one user in the data base had creat the "Title" name. (if there is user try to creat, DBMan will tell the user that the "Title" has been taken.)
Mar 16, 1999, 8:07 AM
Veteran / Moderator (8669 posts)
Mar 16, 1999, 8:07 AM
Post #2 of 7
Views: 2597
You're referring to a field in a record? If so, the way to do it would be to set your $db_key to the title field and set $db_key_track to 0. That way if another user tries to enter a title that was already entered, script will reject the record, based on a "duplicate key error."
------------------
JPD
------------------
JPD
Mar 29, 1999, 11:12 AM
Veteran / Moderator (8669 posts)
Mar 29, 1999, 11:12 AM
Post #4 of 7
Views: 2604
Look in the default.cfg file. Just below where you define the fields, there is a line
$db_key =
If the field that you don't want duplicated is called "Title", change the line so that it reads
$db_key = 'Title';
A little further down there is a line that says
$db_key_track = 1;
Change that line so it reads
$db_key_track = 0;
------------------
JPD
$db_key =
If the field that you don't want duplicated is called "Title", change the line so that it reads
$db_key = 'Title';
A little further down there is a line that says
$db_key_track = 1;
Change that line so it reads
$db_key_track = 0;
------------------
JPD
Mar 30, 1999, 2:38 AM
User (119 posts)
Mar 30, 1999, 2:38 AM
Post #6 of 7
Views: 2599
Hi Aston
JPD is right...
What you can do though is the following.
In the sub validate_record (db.pl) right after
if ($data[$db_key_pos] eq $in{$db_key}) {
return "duplicate key error";}you can add something like this...
Field_Name is the name of the field you are trying to check on (same name as the one given in .cfg) and the [1] in $data[1] is the number of the Field_Name in your .cfg
Cheers
-JO
JPD is right...
What you can do though is the following.
In the sub validate_record (db.pl) right after
Code:
@data = &split_decode($line); if ($data[$db_key_pos] eq $in{$db_key}) {
return "duplicate key error";}
Code:
if ($data[1] eq $in{'Field_Name'}) { return "duplicate field error Field_Name";} #unique keys for Field_NameField_Name is the name of the field you are trying to check on (same name as the one given in .cfg) and the [1] in $data[1] is the number of the Field_Name in your .cfg
Cheers
-JO