SELECT
tbl_channels.entity_id
, tbl_channel_members.fld_channel_member_id
, tbl_channel_members.fld_active
, clay_hotel.entity_id
, clay_hotel.status
, clay_hotel.publish_data
FROM
claymore.tbl_channel_members
, claymore.tbl_channels
, claymore.clay_hotel
WHERE (
tbl_channels.entity_id = 6
AND tbl_channels.entity_id = tbl_channel_members.fld_rel_channel_id
AND tbl_channel_members.fld_rel_entity_id = clay_hotel.entity_id
AND clay_hotel.status = 'active'
AND clay_hotel.publish_data = 'y'
AND tbl_channel_members.fld_rel_entity_type = 'hotel'
AND tbl_channel_members.fld_rel_entity_id = 752
AND tbl_channel_members.fld_active = 1
AND UNIX_TIMESTAMP(tbl_channel_members.fld_membership_expiry_date) >= UNIX_TIMESTAMP(CURDATE())
);