Probability

$sql .= "IF(`T1`.`Featured_date`, '1', '0') `Featured` ";
should be

$sql .= "IF(`T1`.`Featured_date`, '1', '0') `Featured`, ";