Fix erros in mysql confusing values and fields

sqlite  accepts ` for values, mysql treats it as a field. This patch
makes it work with mysql, but the addslashes function will not work
properly in sqlite. Mysql for now is the priority, but we should support
all database backends in the future.