i have a mysql database and now two tabeles *cool*.
Now i want to link them over Primary Key. One of the tables have a column where only unique rates are saved. The other one have rows which have more than one of the numbers of table one.
So, i want to save a new car in table1 with few colors. The colors should be saved in table2. The problem is the id from table1 schould saved also in table2 automtically. I dont know how i should do this.
So you have many items, and many colours. Each item can have many colours, and each colour can be used for many items. This is called a many-to-many relationship. (In fact, what you have may be more complicated, but one step at a time.)
For a many-to-many relationship, you need a third table. A quick google search on [many-to-many table] came up with an example: