I am trying to build an application in PHP PDO. I need my queries to be very generic i.e. a same query should run in any DBMS, how can I achieve this ?
For example,
MySQL - select * from emp limit 10,20
;
and
MS SQL - select * from (select *, ROW_NUMBER() as cnt from emp)x where cnt between 10 and 20
(something like this)
How can I achieve both of these in in PDO using generic code. SO that i just have to change dbms (and drivers) and then rest of the things work fine.
Please help.
Thanks !