| | |
| | | |
| | | /** |
| | | +-----------------------------------------------------------------------+ |
| | | | program/include/rcube_db_mssql.php | |
| | | | | |
| | | | This file is part of the Roundcube Webmail client | |
| | | | Copyright (C) 2005-2012, The Roundcube Dev Team | |
| | | | | |
| | |
| | | | PURPOSE: | |
| | | | Database wrapper class that implements PHP PDO functions | |
| | | | for MS SQL Server database | |
| | | | | |
| | | +-----------------------------------------------------------------------+ |
| | | | Author: Aleksander Machniak <alec@alec.pl> | |
| | | +-----------------------------------------------------------------------+ |
| | | */ |
| | | |
| | | |
| | | /** |
| | | * Database independent query interface |
| | |
| | | |
| | | $query = preg_replace('/^SELECT\s/i', 'SELECT TOP ' . ($limit + $offset) . ' ', $query); |
| | | |
| | | if (!$offset) { |
| | | return $query; |
| | | } |
| | | |
| | | $query = 'SELECT * FROM (SELECT TOP ' . $limit . ' * FROM (' . $query . ') AS inner_tbl'; |
| | | if ($orderby !== false) { |
| | | $query .= ' ORDER BY ' . $order . ' '; |