I am working on a small project for a social network. My issue is while using multiple inner joins bind_param throws up an error
Fatal error: Call to a member function bind_param() on boolean in /var/www/html/index.php on line <line number>
Here is my code :
$user_id is already being fetched from somewhere else, no issues with that. Also, if I only use a single inner join here, it works.
index.php
$sqlFetchUserList = $db->prepare("SELECT r.* from registered_users r inner join connections c
on r.id = c.connections_userid
inner join connections c
on r.id = c.uid
where c.uid = ? or c.connections_userid = ?");
$sqlFetchUserList->bind_param("ii",$user_id,$user_id);
$sqlFetchUserList->execute();
$sqlFetchUserList = $sqlFetchUserList->get_result();
I am trying to select all the data to and fro wherever there is a corresponding record in the columns.
I know I am doing something wrong here but not able to figure it out so far.