How can making a Drop Down List Such as this form

Discussion in 'PHP' started by lionking, May 25, 2009.

  1. #1
    Hello Everybody

    I want to making a Drop Down List Containing the main section and the Bottom of each main section subsections of this section as in this picture

    [​IMG]

    And I have tried making this method But did not work with me and This is the code Who wrote

    
    
    <select name='' id=''>
               <?php
                $get_sec = mysql_query("SELECT * FROM pic_cat");
                while ($row = mysql_fetch_array($get_sec)) {
                    if ($row['subcat'] == '0') {
                        $catid = $row['cat_id'];
                        echo "<option value='$row[cat_id]'>$row[cat_name]</option>";
                
                        if ($row['subcat'] = $catid) {
                            echo "<option value='=$row[cat_id]'>$row[cat_name]</option>";
                        }
                    }
                }
    
             // $row['cat_id'] = Main Section ID 
            // $row['subcat'] = Sub Section ID
           // $row[cat_name] = Section Name
               ?>
            </select>
    
    
    
    PHP:
    I hope I have clarified the problem​
     
    lionking, May 25, 2009 IP
  2. tguillea

    tguillea Active Member

    Messages:
    229
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    90
    #2
    Is there an example of this online somewhere that you found?
     
    tguillea, May 25, 2009 IP
  3. lionking

    lionking Peon

    Messages:
    33
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I found it in Wallpapers Script into admin Panel
     
    lionking, May 25, 2009 IP
  4. tguillea

    tguillea Active Member

    Messages:
    229
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    90
    #4
    Have you tried using inline CSS in the option tag? You may be able to literally just format the text with CSS but I'm not sure on that.

    Also a link may help if you have it
     
    tguillea, May 25, 2009 IP
  5. lionking

    lionking Peon

    Messages:
    33
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thank You Mr tguillea for trying help me
    I have known how to Make them

    Thank You Again
     
    lionking, May 26, 2009 IP