ADO reports / use proper sql escape function according to database vendor

* ADO reports were always using `mysql_real_escape_string` function which made macro values empty for other databases like postgresql
* Current suggested implementation: if dsn uri starts with 'postgres' then use pg_escape_string function - use mysql_real_escape_string function otherwise

There must be a better way to fix it though but the idea is to be able to use any database vendor (not only MySQL) with ADO connections.