diff --git a/pg4wp/driver_pgsql.php b/pg4wp/driver_pgsql.php index dd44991..2068f51 100644 --- a/pg4wp/driver_pgsql.php +++ b/pg4wp/driver_pgsql.php @@ -145,15 +145,12 @@ { // Here we need to convert the latest query into a COUNT query $sql = $GLOBALS['pg4wp_numrows_query']; - echo '
'.$sql.''; // Remove any LIMIT ... clause (this is the blocking part) $pattern = '/\s+LIMIT.+/'; $sql = preg_replace( $pattern, '', $sql); - echo '
'.$sql.''; // Now add the COUNT() statement $pattern = '/SELECT\s+([^\s]+)\s+(FROM.+)/'; $sql = preg_replace( $pattern, 'SELECT COUNT($1) $2', $sql); - echo '
'.$sql.''; } // Handle COUNT(*)...ORDER BY...