ok Cool, I got it working…
I changed the “1” in the WHERE clause to “$userid” and voila!!! works like a charm after I inserted an if staement to filter the NULL values.
here it is for those who might be interested or were following:
<?php
$userid = $user->data()->id;
$rss = DB::getInstance()->query(" SELECT fscomponents.componentTitle, fscomponents.id, a.attendee FROM (SELECT fscomponents.componentTitle,fsattendances.attendee
FROM fscomponents LEFT JOIN fstraining ON fscomponents.id = fstraining.FSComponentId
LEFT JOIN fsattendances ON fstraining.fireSafetyId = fsattendances.fireSafetyId
WHERE fsattendances.attendee = $userid) AS a RIGHT JOIN fscomponents ON a.componentTitle = fscomponents.componentTitle");
if($rss->count()){
echo '<table>';
echo '<th class="th">Fire Safety Component</th>';
echo '<tr>';
foreach($rss->results() as $lists){
if($lists->attendee == NULL){
echo '<td class="tdLeft"> <a href="firesafety.php?id='.escape($lists->id).'">'.escape($lists->componentTitle).'</a></td>';
}
echo '</tr>';
}
}else{echo 'There is no existing Fire Training Component at the monent';}
echo'</table>';
?>
</section>
Mucha Gracias Amigo StarLion