Sorry about the time it took for a reply!
Thanks for the comment

Glad you like it.
Anyways, try sqlite_escape_string... The thing with SQLite is, that unlike MySQL, SQLite doesn't escape ' with a \, it escapes it with another ' so to escape ' it gets converted to '' which is what sqlite_escape_string does.
The reason htmlspecialchars doesn't work is the fact that the Quote Style parameter needs to be set to ENT_QUOTES in order to convert ' to the html entity. I suppose I make phpLiterAdmin do that..?