Results 1 to 6 of 6

Thread: Help with drop downmenu!

  1. #1
    Join Date
    Mar 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Help with drop downmenu!

    Hello guys! here I am again!

    I've done my system working, now I have a problem with this approached.


    somebody help me what script I would use to populate the content of the second drop down menu with mysql query, to be available when I select some Artist name from the first drop down menu.

    the content of the second drop down menu should be the list of the album of an artist I select from the first drop down menu!

    edit:
    here is my table structures
    Code:
    -- --------------------------------------------------------
    
    --
    -- Table structure for table `album_tb`
    --
    
    CREATE TABLE IF NOT EXISTS `album_tb` (
      `album_sysid` int(11) NOT NULL auto_increment,
      `album_artist` varchar(50) NOT NULL,
      `album_name` varchar(100) NOT NULL,
      `album_year` varchar(50) NOT NULL,
      `created_by` varchar(50) NOT NULL,
      `published_by` varchar(50) NOT NULL,
      `date_created` varchar(20) NOT NULL,
      `date_published` varchar(20) NOT NULL,
      `date_updated` varchar(20) NOT NULL,
      `updated_by` varchar(50) NOT NULL,
      `published` varchar(1) NOT NULL default 'N',
      PRIMARY KEY  (`album_sysid`),
      UNIQUE KEY `album_name` (`album_name`),
      UNIQUE KEY `album_name_2` (`album_name`),
      UNIQUE KEY `album_name_3` (`album_name`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=37 ;
    
    
    
    --
    -- Table structure for table `artist_tb`
    --
    
    CREATE TABLE IF NOT EXISTS `artist_tb` (
      `artist_sysid` int(11) NOT NULL auto_increment,
      `artist_name` varchar(50) NOT NULL,
      `created_by` varchar(50) NOT NULL,
      `published_by` varchar(50) NOT NULL,
      `date_created` varchar(20) NOT NULL,
      `date_published` varchar(20) NOT NULL,
      `date_updated` varchar(20) NOT NULL,
      `updated_by` varchar(50) NOT NULL,
      `published` varchar(1) NOT NULL default 'N',
      PRIMARY KEY  (`artist_sysid`),
      UNIQUE KEY `artist_name` (`artist_name`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=48 ;

    please help me!

    Thank you very much!
    Last edited by d0ds™; 03-02-2010 at 02:57 AM. Reason: add code

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Provide us with your table structure?
    Jeremy | jfein.net

  3. #3
    Join Date
    Mar 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I provide table structure!

  4. #4
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    PHP Code:
    <?php
    $query 
    mysql_query();
    echo 
    '<select name="blah">';
    while(
    $row mysql_fetch_assoc($query)){
      echo 
    '<option value="'.$row["artish_name"].'">'.$row["artish_name"].'</option>';
    }
    echo 
    '</select>';
    ?>
    Jeremy | jfein.net

  5. #5
    Join Date
    Mar 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    thanks a lot! I'll try it.,

    the result of it after I select 2 drop down, is I have to insert the

    Artist Name I selected
    Album Name I selected

    INTO another table via submit

  6. #6
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    I don't understand... does it work or not - and why (if not)?
    Jeremy | jfein.net

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
  •