SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member lionking2's Avatar
    Join Date
    May 2009
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question How can making a DropDown List Such as this form

    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

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

    PHP Code:

    <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>
    I hope I have clarified the problem

  2. #2
    SitePoint Addict
    Join Date
    Jul 2008
    Posts
    213
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What do you mean it does not work? Are you getting an error / blank page, or are you not getting the desired results?


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
  •