php – How to get the result of the selected option on the same page?

query ($ sql);
while ($ row = $ result-> fetch_assoc ()) {
echo "";
}?>