Subject:*
<
Name/Email:*
<
Message Icon:*
<
Select*
<
Message:*
<



Click the Preview to see the content in action.
Options:*
<
Confirmation Code*
<
6 - 1 = ?  
Input the result from the expression
Maximum attempts you can try: 10
*
<
     

Re: Making a field unique
by barryc on 2007/12/19 17:10:34

Yes, that's a good thought, and one that I have been considering. One issue is that if a member drops out, then rejoins at some later time, we re-assign the original member number. As long as we can overwrite the auto-assigned number that might not be a problem. This particular problem will become less and less important as, these days, when a member drops out we simply remove them from the Members groups in Xoops. If they rejoin, we just activate that members group. That way their old number is retained.

I'll play with auto-incrementing on my test site. Thanks.,

Barry
Re: Making a field unique
by wizanda on 2007/12/19 16:55:36

great minds think a like....
Re: Making a field unique
by Catzwolf on 2007/12/19 16:53:59

You beat me to it :-p
Re: Making a field unique
by wizanda on 2007/12/19 16:53:12

You could make the field (in PHP admin) for the user number auto_increment, so it adds a new number for each….
Then make a unique index of that field, will stop it making duplicates…
Re: Making a field unique
by barryc on 2007/12/19 15:19:42

Apparently I had not made it clear originally. The member number field in my 2.2.4 installation has already been created. Each time somebody joins the organization we register them on out site. The XOOPS database serves as our membership database. If a new member has already registered on the site we edit their record to include such things as their member number, join date, expiration date, etc. A couple of different people are involved in administering this aspect.

At present the database field for member number does not have to be unique so that it is possible to enter duplicate numbers for two different people. To avoid that we have to keep track of the numbers or look up what the last number used was. It would be nice if XOOPS would not allow the people doing this work to accidentally enter a duplicate.

I thought of make the field unique directly in the database and tried it, via phpmyAdmin, but it did not work for some reason. I'll have to try it again. Any advice on how to do that?

I also don't know what the behavior will be if I do succeed in doing that. Will I get a standard XOOPS message if a duplicate is entered?

Barry

Who's Online

829 user(s) are online (776 user(s) are browsing Support Forums)


Members: 0


Guests: 829


more...

Donat-O-Meter

Stats
Goal: $15.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $15.00
Make donations with PayPal!

Latest GitHub Commits