I have three tables
menus
+--id---ident---+
|--1----menu_1--|
menus_data
+--id---id_parent---name---------id_lang--+
|--1----1-----------menu_eng------1-------|
|--2----1-----------menu_rus------2-------|
+--3----1-----------menu_arm------3-------+
languages
+--id---name--------+
|--1----english-----|
|--2----russian-----|
|--3----armenian----|
second table store the data about menus (names in all languages), ie. id_parent of second table is id of first.
let's asume i add a new language, with id=4. now i need to give the default values( which must br equal to id_lang
= 1 value) to all menus, so i need to add row in menus_data
table
|--4----1-----------menu_eng------4-------|
and i must do it with all menus from menus
table.
I can do it with tree queries -
- find the list of all menus from
menus
table - find the default value ov each element
- add row in
menus_content
table with that values
but maybe it is possible to do in one query?
Thanks