I have tried in several way and it seems always the result is coming fully filtered which is only few record as per the users. Attach is the query and the picutre in query builder.
$useractivity = new WA_MySQLi_RS("useractivity",$hadithbd,20);
$useractivity->setQuery("SELECT users.UserID, users.UserEmail, activity_user.activityID, activity_user.userid, activity_user.itemGroup, activity_user.itemType, activity_user.itemID, hadithmain.HadithID FROM users LEFT OUTER JOIN activity_user ON users.UserID = activity_user.userid LEFT OUTER JOIN hadithmain ON activity_user.itemID = hadithmain.HadithID WHERE users.UserID = ?");
$useractivity->bindParam("i", "".(isset($_SESSION['UserID'])?$_SESSION['UserID']:"") ."", "-1"); //WAQB_Param1