Hi,
This might be a crazy question, but does anyone know how to add
variables dynamically to a class. Here's what I want to do.
I have a class Model, which I inherit for interfacing with database
tables, much like a classic MVC pattern. I want to be able dynamically
create a variable for each field in that table. This is sort of what I
tried out http://pastebin.com/m3fed09a8
I just need to know if there is a way to do what is on lines 8 - 10,
and how that can be done.
Thanks
Travis
This might be a crazy question, but does anyone know how to add
variables dynamically to a class. Here's what I want to do.
I have a class Model, which I inherit for interfacing with database
tables, much like a classic MVC pattern. I want to be able dynamically
create a variable for each field in that table. This is sort of what I
tried out http://pastebin.com/m3fed09a8
I just need to know if there is a way to do what is on lines 8 - 10,
and how that can be done.
Thanks
Travis
Comment