[eluser]Tim in Tulsa[/eluser]
Hello, all! I'm new to CodeIgniter and hope you can give me some suggestions on this problem.
In my model, I have a function called getDomainList that simply takes a table name and retrieves the database keys and values from a domain table (table with lookup values) and assigns them to an array of key-value pairs. The function works fine and a print_r() statement in the function shows appropriate values before returning the array. For example:
Code:
Array ( [1] => Preschool [2] => Ages 1 - 3 [3] => Ages 4 - 5 [4] => Kindergarten [5] => 1st - 2nd Grade [6] => 3rd - 4th Grade [23] => 5th Grade [8] => Junior High/Middle School [9] => High School [10] => Adult )
However, when I call this function from my controller to assign the list of values to my $data array (e.g.,
$data['ages_grades_list'] = $this->workroom_model->getDomainList('ages_grades');), I get the error:
Code:
A PHP Error was encountered
Severity: Notice
Message: Array to string conversion
Filename: controllers/workroom.php
Line Number: 76
I can't figure out why this is happening and I don't understand why PHP would be trying to do an implicit cast to a string.
Thanks for any help/advice that you can provide.
Tim