I am laying pretty good odds that you would have to automatically reload the page after choosing the value of the first dropdown, the dropdown sleection is made client side, PHP queries are done server-side, so you would have to put an "onChange" in the form field and have it reload and querying on the value of the first selection.
Or that is what I am guessing anyway, maybe someone else has a better idea...