SQL error (No database selected)
in (
select link from product_groups where prodgroup_id='2'
)

SQL error (No database selected)
in (
select count(*) from affiliates where affiliate_id='1027'
)