Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $rows = $this->getPosts();
- foreach ($rows as $row) {
- $row->likes = $this->getLikes($row->id_post);
- }
- // now you have everything in one object
- ?>
- <?php foreach ($rows as $row): ?>
- <div class="POST">
- <?php for($i=0; $i<=3; $i++): ?>
- <?= $row->likes[$i]->firstname; ?>
- // this will loop 3 user likes
- <?php endfor; ?>
- </div>
- <?php endforeach; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement