The scenario: a table has multiple columns containing the dates for accounting timeframes (column names: at01, at02, at03, etc. and values 2011-01-31, 2011-02-28, etc.) for 12 months (there are actually 13 columns for this though for some reason so it goes at01, at02, … at13).
Since the fiscal year may not match the actual calendar year, it is not always the case where the last two characters of the column name (e.g. at01) will match the current month (01 for January). There are also other columns in the table.
I have to take the returned data from a query limited to one row result (e.g. select * from table limit 1) and use a for loop to see which of the
columns has the needed value. I am currently trying to use a for loop to go through these values which I will compare to the current year, month and day.
The problem I am encountering so far is that the values in the columns are not all returning. Here is my current code:
The last echo using the alert box appears the correct number of times but it only shows 2 of the values (last time I ran it I believe it only showed the at11 and at12 column values).
This type of PHP looping through columns of one record for this scenario is new to me so any advice or pointing to a tutorial would be greatly appreciated.