Populate HTML/PHP Dropdown Based on First Dropdown Selection

前端 未结 2 591
[愿得一人]
[愿得一人] 2021-01-16 08:25

I Have 1 Drop Down Which Is Used For Category (Food, Drink etc)

In my MYSQL Table (t_menu_category) I Have :

+----+---------------+------------------         


        
2条回答
  •  花落未央
    2021-01-16 08:52

    I have a simple solution to select states depending on a country php/javascript/mysql

    MySQL tables

    country 
          country_code varhar(5)
          country_name varchar(100)
    
    state
          country_code varhar(5)
          state_code   varchar(5)
          country_name varchar(100)
    

    Country/State selection in main.php file

    
        
         Country
                Execute($sql);
                    echo '';
                ?>
    
         State
                Execute($sql);
                    echo '';
                ?>
       
    
    

    Java Script

    
    
                                     
                  
提交回复
热议问题