Log in

View Full Version : Help with drop downmenu!



d0ds™
03-02-2010, 02:45 AM
Hello guys! here I am again!

I've done my system working, now I have a problem with this approached.
http://img535.imageshack.us/img535/170/query.png

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



-- --------------------------------------------------------

--
-- 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!

Nile
03-02-2010, 02:48 AM
Provide us with your table structure?

d0ds™
03-02-2010, 03:50 AM
I provide table structure!

Nile
03-02-2010, 03:55 AM
<?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>';
?>

d0ds™
03-02-2010, 05:54 AM
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

Nile
03-02-2010, 12:43 PM
I don't understand... does it work or not - and why (if not)?