Hi. I have a problem. I am working on a database that already has over 100 users. But now I have found that I should have made the userid the db_key. Currently the db_key is a number and I have db_key_track turned on. The reason I want to change the key to the userid is because I want to limit users to one record per account. I can not find any posts that explains how to do this unless the db_key is the userid. If I do change it, will it corrupt by database? If so, how can I do it safely? Or, even better, how can I limit users to one record without changing the db_key to the userid?
Apr 5, 2000, 6:58 PM
Veteran (17240 posts)
Apr 5, 2000, 6:58 PM
Post #2 of 5
Views: 1798
One suggestion is to change the following codes in the sub add_record routine in the db.cgi file:
to the following:
Don't gaurantee this will work...but you can give it a shot.
Regards,
------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.
Code:
if ($counter++ > 50);to the following:
Code:
if ($counter++ = 1);Don't gaurantee this will work...but you can give it a shot.
Regards,
------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.
Apr 6, 2000, 9:43 AM
Veteran / Moderator (8669 posts)
Apr 6, 2000, 9:43 AM
Post #4 of 5
Views: 1790
Do you have users who have more than one record in the database? If not, you can just change the value of $db_key in your .cfg file and set $db_key_track to 0.
If there are users who have more than one record in the database, you'll need to go through and delete those extra records first.
------------------
JPD
If there are users who have more than one record in the database, you'll need to go through and delete those extra records first.
------------------
JPD
Apr 6, 2000, 4:43 PM
Veteran / Moderator (8669 posts)
Apr 6, 2000, 4:43 PM
Post #5 of 5
Views: 1797
I don't know how quick it would be. The only thing I can think of would be to search for each user. That would take some time.
Or you could do a "List All" and set the sb= to the number of your userid field. Then you could scroll through the records and see if there was anyone with duplicate records.
------------------
JPD
Or you could do a "List All" and set the sb= to the number of your userid field. Then you could scroll through the records and see if there was anyone with duplicate records.
------------------
JPD