Check user if subscribed to my channel

That question is beyond the scope of this forum really.

Thats a lot of “what ifs” which depends on your Langauge, Database engine and other stuff.
So you just need a basic langauge/db primer on the language you are using.