select t2.tstoreid,t2.fstorename,t2.faddress,t2.fphonenumber from tagents t1
inner join tstore t2 on t1.siteid=t2.siteid and t1.tagentsid=t2.tagentsid
where t1.siteid=$siteid$ and t1.tagentsid=$tagentsid$