I am trying to create a set of dropdown boxes that are interconnected using PHP and JavaScript.
My objective is to read an input value from a dropdown box, and use it to determine the values of other dropdown boxes.
An example of this is a dropdown list for States where the user takes the following actions:
I wish to do something like this, but reading value from the Database and use the afore mentioned techonologies.
Database queries are executed by PHP. PHP is executed on the server-side.
HTML is rendered on the client-side, which is where user interactions take place.
So to get information from the database based on user interaction, you need to make an HTTP request to get information back from the server.
To do this, you would use AJAX. Read up on that for the solution to your problem.
Without specifying any libraries that you are using one can only guess. However, after a quick search, I recommend the following plugin:
Github also has a very interesting project regarding this:
These solutions will help you avoid the need to use a DB. However, if you really need to do it, then you have to use AJAX and make at least a request to the server.
Overall if you use a library like jQuery or a Framework like Angular things can be easier, but you can still manage with what you have.
Hope it helps!