If you are getting an error notice from your database, it is highly likely that you need to fix that before it will save edits. Select the menu Extensions > Manage
and click Database
and see if you need to synchronise or fix it.
I have experienced this issue myself, and if your database is up to date, then it is the issue of TinyMCE stripping formatting characters, though changing the filters for the superuser should work.
But you do need to ensure that you clear your cache including resetting the expired cache, and logout. Reset your browser cache, and exit the browser and then reload. It should now work.
My preferred is JCE. I've found that I never have this issue with JCE, and it has better control over the formatting of special characters.
A bit OT but a simpler way to add code is to use Sourcerer from NoNumbers which enables direct inclusion of code between {source}...{/source}
tags. Use this with JCE and you have covered every option.