可以判断。
select count(*) from 表2 where yid=用户ID and tid=帖子ID用户id,跟帖子id在你的页面应该能取到吧。