I'm beginning with PHP and i need your help.
I create a try to list all members who has the same interest that the current_member( i mean the connected member ).
I write this :
$current_members = params('current_member');
$members_all = option('db')->query('SELECT * FROM members WHERE interest = $current_members["interest"] ORDER BY lastname, firstname')->fetchAll();
set('members_all', $members_all);
When I go on my page I have the error : Fatal error: Call to a member function fetchAll() on a non-object
And in my view I just write this :
<h2 id="member-<?= $member['id'] ?>">
<?= avatar_tag($member,'30x30') ?>
<a href="<?=member_url_for($member)?>"><?=$member['firstname']?><small> <?= $member['lastname'] ?></small></a>
</h2>
I dont understand this error, anyone can help me ?
Thank's for your help.