Solution Found After trial and error
function UnreadJournalCount() {
require($_SERVER['DOCUMENT_ROOT'] . 'link.php');
$NotificationsListTotalNew = new WA_MySQLi_RS("NotificationsListTotalNew",$link,0);
$NotificationsListTotalNew->setQuery("SELECT * FROM journal");
$NotificationsListTotalNew->execute();
$UnreadCount = 0;
while(!$NotificationsListTotalNew->atEnd()) {
$isRead = CheckJournalRead($NotificationsListTotalNew->getColumnVal("jid"),$_SESSION['pid']);
if($isRead == "false"){ $UnreadCount = $UnreadCount + 1; }
$NotificationsListTotalNew->moveNext();
}
return $UnreadCount;
}