Making a field unique |
1/24/2008 7:23:20 PM |
PHPRunner General questions | |
H
horsey_kim author
I am sure I saw it somewhere. But how do I make a field like username require when entering in a new one that it be unique? |
|
A
|
alang 1/24/2008 |
You can certainly do it in the database. Using DB admin tool like SQLyog, just add an index to the table for the particular field and then mark it as unique. If you try and add a record with the same data in that field in your PHPR project, the system will error but the message may not be as "user-friendly" as what you might be after. |
H
|
horsey_kim author 1/28/2008 |
I thought I saw something in phpr. I did want it to be user friendly and not some mysql error that confuse people. |
H
|
horsey_kim author 2/4/2008 |
UPDATE: Using some of the code I found Jane had given someone else with a slight change it worked! of course you have to use your table name and field names. |