mysql - Using reserved words in queries that can run on different database servers -
i have used backticks (`) in select queries escape fields such 'first-name'. work on mysql. these queries run through dbo class in php application , application able use other database servers, such mssql , posgres.
what best approach allowing problematic field names used across of these database servers? thinking of taking fields array , quoting them escaping character appropriate each.
[edit] clarify: building tool used map configurations stored within php application fields of external database. wanted escape these precaution because have no idea field names mapped , used within queries.
the cross-dbms mechanism (as defined in sql-92 , other standards) using double-quoted delimited identifiers. according this reference it's supported.
it's worth nothing mysql allows enable/disable syntax still need ensure session settings correct before issuing query.
Comments
Post a Comment