Hello Everyone,
I have a DB that I'm developing, that I've currently got functional, but I want to clean up the output.
Currently, I have a site that displays currently available courses, listed by date. It shows the following:
Course Date Course Title Notes
2005-12-20 Course1 9am-5pm
2005-12-23 Course2 6pm-10pm
2005-12-26 Course1 9am-5pm
2005-12-30 Course1 9am-5pm
I'd like it to group by Course (if one is schedule), list the actual course title only once in my output, and then under each Course Title Heading list the dates and notes, like so:
Course One
2005-12-20 9am-5pm
2005-12-26 9am-5pm
2005-12-30 9am-5pm
Course Two
2005-12-23 6pm-10pm
I have three tables currently, one to hold the courses, one to hold locations, and one to hold scheduled dates:
CREATE TABLE `academy_loc` (
`loc_id` int(5) NOT NULL auto_increment,
`location_st` varchar(5) collate latin1_general_ci NOT NULL,
`location_co` varchar(25) collate latin1_general_ci default NULL,
PRIMARY KEY (`loc_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=3 ;
CREATE TABLE `academy_main` (
`main_id` int(5) NOT NULL auto_increment,
`loc_id` int(5) NOT NULL,
`course_title` varchar(150) collate latin1_general_ci default NULL,
`course_desc` text collate latin1_general_ci,
`class_type` varchar(15) collate latin1_general_ci NOT NULL,
PRIMARY KEY (`main_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=40 ;
CREATE TABLE `academy_sched` (
`sched_id` int(11) NOT NULL auto_increment,
`main_id` int(11) NOT NULL,
`course_date` date default NULL,
`sched_notes` text collate latin1_general_ci,
PRIMARY KEY (`sched_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=75 ;
Thanks in advance!!