var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Unique index acrosss 2 tables
I have two tables: Users and companies. Both have field EMAIL as unique
Is there any way to prevent duplicated email acrosss different tables?
The idea is to prevent a company and a user with same email address.
Currently I check it at moment of register wether the email exists on both tables, but I'd like to have something more solid.
I'm using MySQL 5, MyISAM
Thanks in advance
You can't do that.
why not redesign your db and have a table to hold unique email addresses and created FK's from the other 2 tables.
Not with MyISAM
Originally Posted by scottb
Originally Posted by shammat
Using 1 table instead of 2, you can solve your problem:
1- Email (PK)
2- Type: User/Company
Tags for this Thread