Now I can start working with the table data. But this feels very wrong,plus updating the data in the table can't be done in the regular way I usually work with Active records.
When I try to access the data directly, it works for tabelname->id. But when I try to do this with the other columns: tablename->column\[1\], I get the following error message:
PHP Fatal error: Uncaught exception 'ActiveRecord\\UndefinedPropertyException' with message 'Undefined property: Tablename->column
Does anybody have a solution where I can still work with the fields in an arraylike fashion?
Mysql: Serverversie: 5.1.41-3ubuntu12.8
PHP: PHP Version 5.3.2-1ubuntu4.14
Mark BraspenningWed Feb 22 18:08:31 -0500 2012
fixed it by renaming the columns to column_1 and than accessing them in two steps:
Subject: Working with active records in combination with a table with array like column names
My table looks like this:
The way I now access the data in the table is via the following method:
Now I can start working with the table data. But this feels very wrong,plus updating the data in the table can't be done in the regular way I usually work with Active records.
When I try to access the data directly, it works for tabelname->id. But when I try to do this with the other columns: tablename->column\[1\], I get the following error message:
PHP Fatal error: Uncaught exception 'ActiveRecord\\UndefinedPropertyException' with message 'Undefined property: Tablename->column
Does anybody have a solution where I can still work with the fields in an arraylike fashion?
Mysql: Serverversie: 5.1.41-3ubuntu12.8
PHP: PHP Version 5.3.2-1ubuntu4.14