I have a table called events and am displaying past, present and upcoming events to site visitors. I also have a table called entries where coaches can post play by play commentary about a particular event. Up until today, I was only listing the event name for future events as opposed to linking to the commentary page as I never expected there would be commentary posted for a future event. Now, they want me to check to see if a record exists in the entries tables and if so, link the event name to the commentaries page.
Current code looks like:
So, here’s the synopsis:
I query Events table
I then need to query the entries table to see if there are any entries matching the event ID
If there are…include the a tag
I guess I need to add a second query (or query within a query) of the entries table I am just not sure how do it.
I hope I am clear enough.
Current code looks like:
Code:
<CFQUERY name="future" datasource="#dsn#">
SELECT *
FROM Events
WHERE datediff(d, eventdate, getdate()+ 1) < 1
AND OrgID= '#ORGID#'
ORDER BY eventdate,eventname
</cfquery>
<table>
<cfoutput query=”future”>
<tr>
<td align="left" valign="top">
<font size="2" face="Georgia, Times New Roman, Times, serif">
<a href="[URL unfurl="true"]http://www.webscore.net/rb/commentary.cfm?eventid=#eventid#&orgid=#orgid#")">#EventName#</a>[/URL]
</font></tr>
</cfoutput>
</table>
So, here’s the synopsis:
I query Events table
I then need to query the entries table to see if there are any entries matching the event ID
If there are…include the a tag
I guess I need to add a second query (or query within a query) of the entries table I am just not sure how do it.
I hope I am clear enough.