summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--adodb-lib.inc.php18
1 files changed, 10 insertions, 8 deletions
diff --git a/adodb-lib.inc.php b/adodb-lib.inc.php
index e28db133..b0ec8230 100644
--- a/adodb-lib.inc.php
+++ b/adodb-lib.inc.php
@@ -423,14 +423,16 @@ function _adodb_getcount(&$zthis, $sql,$inputarr=false,$secs2cache=0)
} else
$rewritesql = "SELECT COUNT(*) FROM (".$rewritesql.")";
- } else if (strncmp($zthis->databaseType,'postgres',8) == 0
- || strncmp($zthis->databaseType,'mysql',5) == 0
- || strncmp($zthis->databaseType,'mssql',5) == 0
- ) {
- $rewritesql = "SELECT COUNT(*) FROM ($rewritesql) _ADODB_ALIAS_";
- } else {
- $rewritesql = "SELECT COUNT(*) FROM ($rewritesql)";
- }
+ } else if (strncmp($zthis->databaseType,'postgres',8) == 0
+ || strncmp($zthis->databaseType,'mysql',5) == 0
+ || strncmp($zthis->databaseType,'mssql',5) == 0
+ || strncmp($zthis->dsnType,'sqlsrv',5) == 0
+ || strncmp($zthis->dsnType,'mssql',5) == 0
+ ){
+ $rewritesql = "SELECT COUNT(*) FROM ($rewritesql) _ADODB_ALIAS_";
+ } else {
+ $rewritesql = "SELECT COUNT(*) FROM ($rewritesql)";
+ }
} else {
// now replace SELECT ... FROM with SELECT COUNT(*) FROM
if ( strpos($sql, '_ADODB_COUNT') !== FALSE ) {