some sql injection vulnerabilities fixes

+ some sql injection vulnerabilities fixes
+ new sql injection safe methods in mysql wrapper