Re: MSSQL and DB::limitQuery

From: Date: Wed, 18 Jun 2003 15:12:12 +0000
Subject: Re: MSSQL and DB::limitQuery
References: 1 2 3  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-6101@lists.php.net to get a copy of this message
James 'Chip' Kaufman wrote:
On Tuesday 17 June 2003 18:17, Mark B. Elrod wrote:
I am writing an app in PHP and I wanted it to be fairly portable across different DBs so I decided to try using PEAR. So far I have been pretty happy but I am now having a problem with DB::limitQuery. In short it always returns the complete result set. Is this a known bug? I looked through the archives and found some advice to use DB_Pager so I might just go that route but I see now reason why limitQuery would not work. Maybe it is not implemented yet? elrod
I just noticed you are using mssql. That doesn't support the limit query function like MySQL does.
The driver might not, but the database does. It doesn´t use the LIMIT keyword, though. You have to write something like: SELECT TOP(10,20) ...(normal query goes here)... Can´t remember the exact syntax. Maybe the driver can be enhanced to look for the first SELECT statement, rip it out of the query and replace it with SELECT TOP(x,y)? CU Markus

« previous php.pear.general (#6101) next »