Using SQL within cfscript
Hey everyone,
I am using the cfscript I got for a calendar from this website: http://www.drisgill.com/files/cal.txt
Its fairly straight forward and displayed a generic plain calendar for the month. I am trying to make it so the calendar fills dynamically with information I pull from a database. So essentially, as the calendar adds days I want it to see if that date equals the date I have in the DB, if it does then it would display simple text like, "Event."
This is the code that loops through and creates the calendar, keep in my this is cfscript
// loop thru all the dates in this month
for (i=1; i lte DaysInMonth(firstDay); i = i+1) {
//is it Sunday? if so start new row.
if (DayOfWeek(CreateDate(curYear, curMonth, i)) eq 1) {
outString = outString & "<tr>";
}
// insert a day
outString = outString & "<td align='left' valign='top' width='#width#px' ";
if(CreateDate(curYear, curMonth, i) eq CreateDate(year(now()),month(now()),day(now()))){
outString = outString & "class='day-current'";
}else{
outString = outString & "style='background-color: whitesmoke' ";
}
outString = outString & "height='#height#'>#i#<br></td> ";
I realize that last line is where I need my output to go but for the life of me I cant get any queries to run or compare in cfscript. I am fairly new to cfscript.
Any help would be greatly appreciated!!
Thanks!
