You have not explained the work flow. I have to figure it out from your incomplete code.
If I understand you correctly, you are trying to retrieve a list of books from book table, populate a dropdownlist, then, on the form, user selects a bookshop from the bookshop dropdownlist and selects a book from the book dropdownlist, press submit, and the bookshop_id, book_id, and quantity got inserted into the books_bookshop table.
There are too many problems here to be able to help you. You do not seem to know the code, neither php nor html, where did you get it from? Getting code from nowhere and trying to piece them together without understanding them and hoping that it works out of the box rarely happens. Giving you the code is not going to help you to learn, I would rather give you the logic.
1. Where do you get the bookshop information to populate the bookshop dropdownlist? You will populate bookshop name as text for user to see but the the most important piece is the bookshop_id that is required to insert into the books_bookshop table
2. You have to retrieve book_id, book_name, may be quantity from the book table, populate the book dropdownlist with book_name as text, and the other two as hidden field.
3. When the user select a bookshop and book from the respective dropdownlists, press submit, it is the bookshop_id, book_id, and quantity that will be sent to the receiving page, it appears that it is a postback to the same page and they are captured in the $_POST variables like $+POST['bookshop_id']
Suggest you learn these:
1.
php_forms.asp[
^]
2. You should go for mysqli as mysql is deprecated, also use prepared statement to prevent sql injection. Refer:
prepared-statements-in-php-and-mysqli[
^]