Cannot Count rows in a SQL 2005 Result Set #2703

lepiou opened this Issue Oct 8, 2012 · 3 comments


None yet
5 participants

lepiou commented Oct 8, 2012


I've got the same problem as with sqlsrv driver and SQL Server 2005 database.

Any solution ?



bartko-s commented Nov 30, 2012

Same problem with sqlite driver

The problem seems to exist with any SQL Server version. This comes from the following remark :

"sqlsrv_num_rows requires a client-side, static, or keyset cursor, and will return false if you use a forward cursor or a dynamic cursor. (A forward cursor is the default.)"

seen on

The problem is that Zend Framework doesn't seem to allow using any type of forward cursor.

So it means that the function sqlsrv_num_rows() and so the function AbstractResultSet::count() will always return false.

My recommandation would be :

  • either ZF2 provides a way to use forward cursors
  • either ResultSet should throw an exception with a proper message in method count() to explain the problem



ThaDafinser commented Nov 5, 2013

@bartko-s @lmirguet @lepiou is this still a problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment