Welcome Guest, Not a member yet? Register   Sign In
Getting data in a big array codeigniter
#4

By default, arrays start with index 0. So 0 is the key of the first element in an array, 1 for the next element and so on.

In your code:
PHP Code:
$data['suggest'] = array(
'suggestedUser' => $data['suggested'][0]->suggestedUser,
'mutualFriend'  => $data['suggested'][0]->mutualFriends,
); 
you only put the first element [0] in the 'suggestedUser' and 'mutualFriend' elements. That's why you only get one user.
Reply


Messages In This Thread
Getting data in a big array codeigniter - by tp45 - 09-27-2019, 01:05 PM
RE: Getting data in a big array codeigniter - by Wouter60 - 10-01-2019, 09:48 AM



Theme © iAndrew 2016 - Forum software by © MyBB