bas
|
| Posted: 07/19/2009, 2:10 PM |
|
I have a simple Users table in my Db (MySQL)
UserID, LoginName, Password, Company Name, email
UserID is PK, AutoInc
LoginName, PK, not Null
(1) When I insert items directly into the Db (using SQLyog comunity) I am
able to insert duplicates for LoginName
I need to make sure LoginName is unique
(2) Created a NEW Record Form using builder and setting LoginName as UNIQUE
& Required
Required works ie. get a message if I leave it blank but I don't receive any
error saying I have duplicated LoginName
What am I doing wrong?
|
|
|
 |
ckroon
Posts: 869
|
| Posted: 07/19/2009, 3:19 PM |
|
You need to set that up in MYSQL.. on the Users table.
You have to create an Index for the Login field and set it to 'Unique'.
_________________
Walter Kempees...you are dearly missed. |
 |
 |
bas
|
| Posted: 07/20/2009, 1:34 AM |
|
That's the thing - I did! and so well confused
Manage Indexes - Edit Primary Index this was only the UserID field so I
ticked the LoginName
Exported Table data to CSV and re-imported it.
Added a record - OK
Added a record - same LoginName - OK.... obviously this is not right!
Created a NEW Form with LoginName, Password etc
**CCS does not populate this field even though I selected it
So I went into HTML and added it
When I create a new record LoginName is blank in the database (created 2
records both blank LoginName)
"ckroon" <ckroon@forum.codecharge> wrote in message
news:54a639bf1c2e31@news.codecharge.com...
> You need to set that up in MYSQL.. on the Users table.
> You have to create an Index for the Login field and set it to 'Unique'.
>
> _________________
> Walter Kempees...you are dearly missed.
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.yessoftware.com/
>
|
|
|
 |
bas
|
| Posted: 07/20/2009, 2:39 AM |
|
I think I sorted it.
Ticking the LoginNAme creates a compound PK
So created a new Index PK_LoginName with LoginName unique
Form works too.
Thanks
"ckroon" <ckroon@forum.codecharge> wrote in message
news:54a639bf1c2e31@news.codecharge.com...
> You need to set that up in MYSQL.. on the Users table.
> You have to create an Index for the Login field and set it to 'Unique'.
>
> _________________
> Walter Kempees...you are dearly missed.
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.yessoftware.com/
>
|
|
|
 |
damian
Posts: 838
|
| Posted: 07/20/2009, 2:57 AM |
|
did you use the project builder?
im pretty sure that your login page will check for uniqueness if you let the project builder build it and you set the security settings properly....
create a new project on the same database and make sure you set the security settings at that time and see if it works this time around. it should only take 10 mins or so.
_________________
if you found this post useful take the time to help someone else.... :)
|
 |
 |
damian
Posts: 838
|
| Posted: 07/20/2009, 2:59 AM |
|
oooops looks like you answerred while i was answering.... yes i am a slow typist!
_________________
if you found this post useful take the time to help someone else.... :)
|
 |
 |