sql, problem with join and presentation

From: Date: Sun, 15 Feb 2004 21:56:00 +0000
Subject: sql, problem with join and presentation
Groups: php.db 
Request: Send a blank email to php-db+get-32950@lists.php.net to get a copy of this message
Currently I display a list of classes. Simplified SQL and display below: SELECT * FROM classes WHERE classCategory='$Category' AND classDeleted=0 ORDER BY $order $reorder The presentation is: +------------------+----------+------------+ | CLASS TITLE | LOCATION | CLASS CODE | +------------------+----------+------------+ | CLASS DESCRIPTION <br/><br/> | | CLASS INSTRUCTOR <br/><br/> | | CLASS TIME | +------------------------------------------+ Now, things are getting a little more complicated. Each class is going to have sections. So the display will be: CLASS TITLE CLASS DESCRIPTION CLASS CODE : CLASS SECTION .. LOCATION .. CLASS TIME .. INSTRUCTOR example (simplified) +---------------------------------------------+ | INTRO TO AAA | +---------------------------------------------+ | This is a really interesting .... | | | +---------+-----+------------+----------------+ |HT-111:A | NYC | 12:00-4:00 | Albert Alkin | |HT-111:B | JC | 2:00-6:00 | Bob Bailey | |HT-111:C | BX | 4:00-8:00 | Chris Cawley | +---------+-----+------------+----------------+ I'm having a really hard time coming up with the sql for this. I want to (pseudo) select * from classes and classSections where classDeleted=0 and group by classCode tables below CLASSES classID classDescription classTexts classCost classDeleted CLASSCODES classCodeID classID classCodeSection classDate classTime classLocation classInstructor I'm going nuts trying to get this. I must be missing something simple. (using mysql) thx for any clues Gil

« previous php.db (#32950) next »