Dynamic Drop Down Menu

Hello. I’ve searched the web trying to solve this problem and I haven’t been able to figure it out. I am trying to create a menu where a list of car makes are pulled from a database so one can be selected in a form and then the list of models for the car make selected will be available as an option. I have the database made. The first table is title category and it has a cat_id number with the values being the car makes. The second table is titled subcategory and it lists the car models. The column titled cat_id in this table matches the number in the category table where the makes are stored.

Here is a sample image of the database:

After the user selects a car make, run a sql query joining the 2 tables on cat_id for the selected make to get the models for that make. The use a WHILE loop to loop through the query’s result set to output the car model options.