Results 1 to 2 of 2

Thread: Change subcategories values...

  1. #1
    Join Date
    Apr 2006
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Change subcategories values...

    I have 2 dropdown that I have to associate:


    This is the category dropdown:
    PHP Code:
    <select name="cat_ID" id="cat_ID" tabindex="3">
                                    <?
                                        $sql 
    "select cat_ID, cat_nome from cat_links order by cat_nome" ;
                                        
    $query query($sql);
                                        
    $conta mysql_num_rows($query);
                                        for (
    $i=0;$i<$conta;$i++)
                                        {
                                            
    $arrl mysql_fetch_array($query);
                                    
    ?>        
                                            
                                              <option value="<?php echo $arrl["cat_ID"]; ?>"><?php echo $arrl["cat_nome"]; ?></option>
                                       <? ?>    
        
                          </select>
    And this is the subcategory dropdown:
    PHP Code:
    <select name="subcat_ID" id="subcat_ID" tabindex="3">
                                    <?
                                        $sql 
    "select s.subcat_ID, s.subcat_nome from subcat_links s, cat_links c where c.cat_ID = ".$arrl["cat_ID"]." order by s.subcat_nome" ;
                                        
    $query query($sql);
                                        
    $conta mysql_num_rows($query);
                                        for (
    $i=0;$i<$conta;$i++)
                                        {
                                            
    $arrl mysql_fetch_array($query);
                                    
    ?>        
                                            
                                              <option value="<?php echo $arrl["subcat_ID"]; ?>"><?php echo $arrl["subcat_nome"]; ?></option>
                                       <? ?>    
        
                          </select>

    What I want is when in choose a category, the subcategories will change to correpond. Can you help me??

  2. #2
    Join Date
    Apr 2006
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Do you have any ideia for resolve this case?? Do you have a script example for this for correspond Categories and subCategories that are in a mySql DB??
    I really need your help!!!....

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •