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

(10-02-2019, 05:16 AM)tp45 Wrote: Ok it worked this way

PHP Code:
Controller
$data
['suggested'] = $this->User_model->getFriendSuggestions();
View
<?php foreach ($suggested as $users): ?>
            <?php print_r($users->suggestedUser); ?>
            <?php //print_r($users->mutualFriends); ?>
          <?php endforeach ?>
Thank you for helping me and by replying
now it gives me all users as it should, i just have display each user

Just trying to offer advice to make your life easier by saying you don't have to enclose each line of the above in PHP tags. In other words, the following will work and might be easier to read (not to mention type).

PHP Code:
<?php 
foreach ($suggested as $users): 
    print_r($users->suggestedUser); 
    //print_r($users->mutualFriends); 
endforeach; ?>
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 dave friend - 10-02-2019, 11:48 AM



Theme © iAndrew 2016 - Forum software by © MyBB