URGENT! - Please, can anyone help with a FK-Design Question
Posted: Sat 30 Aug 2008 08:41
Hey
I don't know, where to ask either...
So, I have the following problem, which I can't solve.
I have two completly different offers tables.
These two tables should be referenced with one invoicenumber table.
In the offers table, I do have an ID field which is set to autoincrement as primary index.
Here seems to be the big problem. - Because, when I set a foreign key in my invoicenumer table, mySQL deletes the offers of both tables.
So, I thought, I could solve this problem when I add a second related column, called offers_type. - This I set to a default value: - In offers table A set to 1 and in offers table B to 2.
In the invoicenumbers table, I do have also added a field with offers_type. - But this is also not working, when I try to add a field, in this case I get an error.
Plese HELP!!!
I don't know, where to ask either...
So, I have the following problem, which I can't solve.
I have two completly different offers tables.
These two tables should be referenced with one invoicenumber table.
In the offers table, I do have an ID field which is set to autoincrement as primary index.
Here seems to be the big problem. - Because, when I set a foreign key in my invoicenumer table, mySQL deletes the offers of both tables.
So, I thought, I could solve this problem when I add a second related column, called offers_type. - This I set to a default value: - In offers table A set to 1 and in offers table B to 2.
In the invoicenumbers table, I do have also added a field with offers_type. - But this is also not working, when I try to add a field, in this case I get an error.
Plese HELP!!!