在php中填充数据库中的多个下拉列表

I have multiple drop downs which are being populated from database but I want something like this.........

  1. Every drop down have same options
  2. If I select one option in any drop down then that option would not be visible in any drop down, but if I deselect it then it would be visible in all drop downs.

I found something that is somewhere helpful But I need this in table row

How to prevent duplicate values in multiple dropdowns using jQuery

Please look it and suggest me any Solution.

Thanks in advance

This has to be done using AJAX https://www.w3schools.com/php/php_ajax_database.asp

When a dropdown value is change an Ajax script should be called which will update the other drop down lists.

Hope this helps. Its not tricky at all you just have to understand the concept.