Closed Thread Icon

Topic awaiting preservation: Pull down menus in php/mysql with 3 levels. Pages that link to <a href="https://ozoneasylum.com/backlink?for=26792" title="Pages that link to Topic awaiting preservation: Pull down menus in php/mysql with 3 levels." rel="nofollow" >Topic awaiting preservation: Pull down menus in php/mysql with 3 levels.\

 
Author Thread
spramod
Nervous Wreck (II) Inmate

From:
Insane since: Sep 2005

posted posted 10-05-2005 09:51

Hi all,

I need some references or code for pull down menus in php/my sql.

i have done this in javascript, but there seems to browser problems.
so i decided to go for php/mysql.

i have 3 levels of data.
1. course_category
2. course_subcategory
3. course_dates

when i select course_category, it should display the sub courses automatically in the pull down menu, and once i select the sub-course, it should select the course_dates relevant to that sub_category.

i need this info to be pulled my_sql database.

please provide me with references for this!
thanks a ton..

H][RO
Bipolar (III) Inmate

From: Australia
Insane since: Oct 2002

posted posted 10-05-2005 14:24

If you know how to do loops in php you should be able to do this. In your database table you will need to obviously have a parent_id for your sub categories so you know what to show when the matching category is selected.

I normally do a recursive loop for this sort of thing so that it handles unlimited levels of menus.

Anyway im sure what you are asking, do you know how to do database queries and php code?

spramod
Nervous Wreck (II) Inmate

From:
Insane since: Sep 2005

posted posted 10-06-2005 10:04

Here's the structure of my tables:
tbl_coursecategory & tbl_subcategory

-------------------------------------------------------------------------
#
# Table structure for Course_category
#
CREATE TABLE `tbl_coursecategory` (
`course_id` int(10) NOT NULL auto_increment,
`course_category` varchar(100) default NULL,
PRIMARY KEY (`course_id`)
) TYPE=MyISAM;



INSERT INTO `tbl_coursecategory` VALUES (1,'Personal Development');
----------------------------------------------------------------------------
#
# Table structure for Course_subcategory
#

CREATE TABLE `tbl_subcategory` (
`subcat_id` int(11) NOT NULL auto_increment,
course_id` int(10) default null,
`subcategory_name` varchar(100) default NULL,
'start_date' date,
'end_date' date,
'fees' varchar(10) default NULL,
'location' varchar(20) default NULL,
'course_presenter varchar(50) default null,
PRIMARY KEY (`subcat_id`)
) TYPE=MyISAM;

#
# Dumping data for tbl_subcategory
#

INSERT INTO `tbl_subcategory` VALUES (1,1,'Supervisory Skills','29-05-05','01-06-05', '4000' 'US', 'David');

-----------------------------------------------------------
thanks a ton..

« BackwardsOnwards »

Show Forum Drop Down Menu