I have a block I need to display but some of the fields do not need to be repeated. I query my database with the following query:
SELECT d.name AS degree, d.description AS description, d.requirements AS requirements,
c.name AS course, dd.yearofstudy AS yearofstudy, dd.semester AS semester
FROM degrees d
INNER JOIN degrees_details dd ON dd.degreeID = d.ID
INNER JOIN courses c ON c.ID = dd.courseID
WHERE d.ID = '" . $recordID . "' " .
"ORDER BY dd.yearofstudy,dd.semester,dd.order
|
I need to have the block break when each yearofstudy and semester field is another year and semester. For example:
First Year (First Semester)
1. Course One
2. Course Two
3. Course Three
First Year (Second Semester)
1. Course One
2. Course Two
3. Course Three
Second Year (First Semester)
1. Course One
2. Course Two
Is there a way to have TBS do this without making multiple calls to the database? The sql query may return a different number of years depending on the degree. I have a template like so, but I don't know how I am going to construct the block to output. Any suggestions?
<div id='right_col'>
<h2>[degreeblock.degree]</h2>
<h3>Description</h3>
<p>[degreeblock.description]</p>
<h3>[degreeblock.yearofstudy]<span>([degreeblock.semester; magnet=span])</span></h3>
<ol>
<li>[degreeblock.course]</li>
</ol>
</div>
|