Trying to hide elements based on database

I did ry to read everything about but having no coding knowledge it is a little bit complicated for me.
I tried applying your code but it is not dong what I want it to do. I’d like the box and everything that is contained inside it to hide. Could it be possible that your code hides the box but not what is inside it?