jwerre
jwerre

Reputation: 9584

Trouble in PDO and sqlsrv land

I set up a site on my local system using PDO and a MySQL Database. I used PDO because when the site goes on the live server I have to user SQL Server and I was hoping PDO would take care of all my query conflicts.

Now that I'm up on the live server I get an error whenever the application uses the "LIMIT" function. I realize this is a MySQL specific function but shouldn't PDO take care of the conflict? How do I fix it so that site will work on MySQL and SQLSRV?

Thanks in advance.

Upvotes: 0

Views: 515

Answers (1)

HLGEM
HLGEM

Reputation: 96552

Never develop in one technology expecting to use a different technology in prod.

It fails because there is no SQL Server equivalent for LIMIT so it can't convert.

If you expect different backends to be possible, use ANSII standard SQL not database specific things. If you expect to use only SQL Server in prod, develop in SQL Server (there is a free version).

Upvotes: 1

Related Questions