0
Problem
I have a table called "entidades_category-script" (let’s call 'A') that has the following keys:
It turns out that it references another table called entidades_category-script-type (let’s just call 'B'), which has only the following records:
Hence, in phpMyAdmin, when I try to insert a new record in table A the following situation happens:
Therefore
What would be causing SELECT to show in its options TABLE B items in this format? The expected would be "id - name", but it ends up showing "id - name; name - id" or this is a default behavior in phpMyAdmin?
Sorry you did not explain what the problem is. Was an error displayed? Maybe a SELECT with the respective result can clarify what the question is.
– anonimo
The SELECT you suggested was presented in the third figure of my question. If you check table B, you can see that there are only two entries in it, whereas SELECT shows 6, because it ends up bringing two blank values, in addition to the two reverse pre-registered records (name - id; id - name). The expected result would be only (id - name).
– Adan Ribeiro
I’m sorry you didn’t present the SELECT code and what you say is the result of what I assume would be a JOIN doesn’t seem believable with the data you say exists in the table.
– anonimo
But it’s not my application I’m talking about. That image is from phpMyAdmin itself. I didn’t program it. It is accessed via the "INSERT" menu after I click on the desired table. This is a question about the database manager interface.I did not enter any SQL or JOIN statements. I just set up FK as presented.
– Adan Ribeiro