Answer the question
In order to leave comments, you need to log in
How to set up a one-to-many relationship between tables in MySQL?
There is a database with two tables:
1. Author - id | name
2. Book - id | author_id | title | description | image (the last one is just a url)
I configured via phpmyadmin so that now the author_id values in the book table are highlighted and when I click on them, I get a row with the desired author from the author table. That is, I made a connection "many to one".
But I also need to make a one-to-many relationship so that by clicking on the author's id, I get rows with all his books from the book table.
And then the skiing felts do not go, or I don’t understand something. In one direction, everything is easy to set up in phpmyadmin, but in the opposite direction it’s impossible to make a connection.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question