[eluser]Michael Wales[/eluser]
You are executing a query and storing it in one variable - then you are trying to perform actions on it's parent array.
You are basically doing this - which simply won't work:
Code:
// Set a value
$people['bob'] = 30;
// Perform an action
substr($people, 1); // <-- This fails
$people is not the same as $people['bob']. $people is an array, where as $people['bob'] is a key within that array.
Think of it like a box (named $people), and then we split that box up into sections (we'll call one half 'bob' and the other half 'mary'). Then we place Bob and Mary's ages in their sections of the box ($people['bob'] = 30; $people['mary'] = 32

. Now - we can't go asking the box the age of Bob, the box doesn't know. We need to ask Bob's section of the box.
In your code - you have made a box, named $people. You then created a section of that box named userquery. What you are intending to do is ask the userquery section of the box how many rows it returned (and then all of those rows). Instead you are asking the box itself.
Try this (no need to get an array involved in this, just confusing things, increasing memory, etc):
Code:
$users = $this->Admin_model->find_selected_user();
if ($users->num_rows() > 0) {
foreach ($users->result() as $row) {
echo $row->user_id;
echo $row->username;
echo $row->password;
}
}