I don't guess I understand what you are saying.
I have these two records in a table:
fname, lname, year
Bob, Smith, 2009
Jake, Thomas, 2011
I run a query similiar to this: SELECT DISTINCT year FROM table. That gives me a column with two dates. 2009, 2011
I want to use those two in the function, but they don't have an ID, so I make $row and $row both equal to each date.
I run another query, this time with this table:
SELECT id, sport FROM table. This gives me an id from the table to use, whereas the first table doesn't have one, me just pulling a column from the middle of each record.
See. With the second one, I can use the ID. With the first one, it doesn't have an ID so I have to make the ID from the value ( year ).
I don't know how to explain it any better. How would you make an associative array that would deal with both of these.
If I have a state file I want to use in the dropdown box, I do the same thing:
That is easy to figure out. Seems the only way for me to get a value for the ID is to do like I did at the top. Extract it with a query then use its value as the id.
Making general purpose functions just seems like a headache.