Added some DB helpers
Fixed execute_safe. If an error occurs $result  will contain 'code' field instead 'errno'