I see your problem now.
You are binding the parameter to: $Existing_Rooms_Test->getColumnVal("room_id")
and you are expecting that to have all of the rows from the previous recordset. Really that would only contain the first row, which is why the first row is the only one being filtered out.
You would have to use a different function to get a comma separated list of all rows to filter them out. If you added this to the top of the page:
<?php
function getAllColumns($rs,$col) {
$allColumns = "";
for ($x=0; $x<sizeof($rs->Results); $x++) {
if ($allColumns) $allColumns .= ", ";
$allColumns .= $rs->Results[$x][$col];
}
return $allColumns;
}
?>
Then you could bind the parameter to: getAllColumns($Existing_Rooms_Test,"room_id")
Another solution, is to just nest the SQL like:
SELECT 7_room.* FROM 7_room WHERE 7_room.room_id NOT IN (SELECT room_id FROM bridge_event_room WHERE bridge_event_room.event_id = 5 GROUP BY bridge_event_room.room_id)