[SOLVED] Nested variables that return another variable
Posted: Thu Jan 15, 2004 4:41 pm
I am using a calendar script that dynamically builds the calendar for each month, I use it for scheduling purposes. I have placed a checkbox in each day so users can indicate they are available that day. This all works great for putting the info INTO the database.
My problem lies in pulling it out so a user can change update their schedules.
My database (MySQL) returns data from an ENUM field that is y or n and I am trying to dynamically turn the 'y's into a "checked" variable so the boxes that they had previously selected will show up checked in the calendar.
I am having a time getting the two nested variables to return another variable that coincides with the output from the database thus properly checking the boxes I want checked.
Basically I have $var1, $var2, $var3... (with numbers 1-31) etc. returned from the DB and I have a variable $i that returns each day for the calendar. I am attempting to replace the number in the $var* field with the $i from the calendar so I get $var# again with the proper corresponding day of the month (1,2,3... etc) instead of them all returning what the answer is for the 1st of the month.
How do I drop the number from the one DB variable and replace it with the corresponding number from the calendar?
My problem lies in pulling it out so a user can change update their schedules.
My database (MySQL) returns data from an ENUM field that is y or n and I am trying to dynamically turn the 'y's into a "checked" variable so the boxes that they had previously selected will show up checked in the calendar.
I am having a time getting the two nested variables to return another variable that coincides with the output from the database thus properly checking the boxes I want checked.
Basically I have $var1, $var2, $var3... (with numbers 1-31) etc. returned from the DB and I have a variable $i that returns each day for the calendar. I am attempting to replace the number in the $var* field with the $i from the calendar so I get $var# again with the proper corresponding day of the month (1,2,3... etc) instead of them all returning what the answer is for the 1st of the month.
How do I drop the number from the one DB variable and replace it with the corresponding number from the calendar?