How can I show a table row if a sub-task exists?
Database info:
- table1 tasks table
- table2 sub-task table
Some tasks have sub-tasks, so how do I create an if statement for the results table: if tasks table has a record in the sub-tasks table display the record below the task record.
<tr>
<td> #taskName# <td>
</tr>
<cfif subtask exists display row>
<tr>
<td>#sub-taskName#</td>
<tr>
</cfif>
Tried this:
<cfif taskID = sub-taskid>
<tr>
<td>#sub-taskName#</td>
<tr>
</cfif>
Not sure if this is the best method and how to loop if more than 1 sub-tasks are present.
There is an example of how to do this at bottom of this page : https://cfdocs.org/cfoutput
use similar to this for sql query
OR use this object to demo code
then output using