Fixed bug in database sync when using mysqli and also added support for raw database inputs