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

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