I've created a dynamically generated calendar in php. Now I am trying to enter data into individual days. I'm trying to get the data to land into a specific date field. What I've done up to this point is run the query to obtain the data within the while loop of the calendar code. This populates the calendar okay, but it means the query has to be run for each day of the month, and this significantly slows the loading of the web page.
So lets say I have a query that generates the following results for each result row:
$day (expressed as integer)
$display = "$col1, $col2";
I think the solution would be to code the $display variable with the day of the month ($display1, $display2, etc.) and then have then echo the variables within the days of the calendar. But this is where I'm a little bit stuck.
I know this is probably a very basic question, but I can't seem to figure out how to get the variable to show with the day number concatenated onto it. The days of the month on the calendar are generated dynamically, so any variables within each day would have to generate dynamically with the appropriate number concatenated onto the variable.
If anyone can help, or has an alternative idea to approach this, let me know.