Gossamer Forum
Quote Reply
UNIQUE
Hi,

I know how to make a field in a table UNIQUE, but have no clue if it's possible to make 1 field on two (!)tables UNIQUE and how to do this!

For example make sure the are no duplicates in the "login" data (= username) so never ever a client will login and get - by accident - the stuff of the supllier with the same login. Putting everything in one table would be a solution, however my current cms-system can't handle this.

client_id | username | password | more clients stuff...
supplier_id |username | password | more supllier stuff...
Quote Reply
Re: [cK] UNIQUE In reply to
If they are in 2 seperate tables, then it shouldn't be a problem. With the example you gave below, you should be able to make 'username' unique in both tables without any problems.

Cheers

Andy (mod)
andy@ultranerds.co.uk


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [Andy] UNIQUE In reply to
Oeps, used the word "on" where I ment "for" Crazy

I mean: I don't want duplicate username due to the fact I would like to use one login-system!
Quote Reply
Re: [cK] UNIQUE In reply to
You'll have to code this on the front-end. Checking for both username columns/attributes within the two separate tables in your web script. There is not really an easy back-end solution for your problem.
========================================
Buh Bye!

Cheers,
Me