Hey. I will try to briefly retell my task, which I cannot solve due to lack of experience.
Imagine that you have a certain table1 with group names (id, group_name, element_name_id) that refers to the id of the element of table2 (id, element_name), and both of them are empty. So this primitive link is built. id - AI.
Suppose: I need to add for one or several requests the fields Smartphone and iPhone, entered by the user. But the fact is that the team needs to know the id from the table of elements in the field element_name_id, which would have to be inserted first, otherwise there will be no matching. In short, it is over this that I break my head, and do not even know what to ask in Google. Obviously, this is an INSERT. It is necessary that in table1 I saw: name: smartphone, element_id -> 0 IPhone.
I work in phpmyadmin and HeidiSQL.