bradgrafelman;10954008 wrote:That sounds like the gist of it, yeah.
$this->mDepartments is just a multidimensional array where each item is an array that represents a row retrieved from the DB. Thus $this->mDepartments[$i] refers to a the ith row retrieved, and $this->mDepartments[$i]['link_to_departments'] is a new pseudo-column in that row.
Okay, but that ties back to my original post.
The table was originally like this...
department_id name
-------------- ---------
0 Regional
1 Nature
2 Seasonal
So, when he assigns that data to "mDepartments", what does the array structure look like?
Is there an additional "column" (e.g. ID) that also reads: 0, 1, 2?
Does $this->mDepartments[$i] refer to the "department_id" or some new "ID" field that PHP added?
And, was ['link_to_departments'] then added on the tail-end like a new "column"?!
After he was done surreptitiously adding that, did the array maybe look like this...
It could like this...
mDepartments = array(
array('', 'department_id', 'name', 'link_to_departments'),
array(0, 0, 'Regional', ''),
array(1, 1, 'Nature', ''),
array(2, 2, 'Seasonal', ''))
or like this...
mDepartments = array(
array('department_id', 'name', 'link_to_departments'),
array(0, 'Regional', ''),
array(1, 'Nature', ''),
array(2, 'Seasonal', ''))
TomTees