Hiding PHP Code
If you're worried about PHP source code, providing you're keeping it on your server and not distributing it, it's all down to keeping your server secure. Nobody can read it without server access (or the mis-configuration of your server). You've included the mysql
tag, you can apply the same logic as PHP for that.
Obfuscating HTML
There is little to no point, if someone wants your markup, a few entities here and there aren't going to stop them. See here