Since the other one was answered correctly and i got a new idea for solving my problem (that's not really like the case under) i start a new thread.
Same example, the cds.id is AUTO_INCREMENT and these two tables does not really have any relations, is there any way to post the generated id to the languages table?
Table for CDs (cds):
id | type
-----------------------
1 | CD
2 | LP
3 | CD
Table for names:
cd_id | language | name
-----------------------
1 | fi | AAA
1 | de | AAACHTUNG
3 | en | CCC
Now the SELECT would be really simlple and the structure is better,
If i now have e form for creating a CD, like
<input... > = the name -> 'best of XX'
<select...> = language -> 'en'
<select...> = type -> 'CD'
and i do a post, how can i do a multiple insert?
The insert to these tables should be...
INSERT INTO cds ('', 'CD');
INSERT INTO languages ('*the generated id in table above*', 'en', 'best of XX');
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…