(Sorry for my english)
Hi, iām using the following adapter https://github.com/fishjerky/phalcon-mssql to connect PhalconPHP with MS-SQLServer2008. In Windows, everything works as expected, but not in Linux Debian 7.
Windows: Extension php_pdo_sqlsrv_53_nts_vc9.dll.
PHP Version: 5.3.9 - Windows 7 Business Edition Service Pack 1 - i586 Phalcon Version 1.3.1
Linux: Extension pdo_dblib.so (PDO Driver for FreeTDS/Sybase DB-lib)
PHP Version 5.4.4-14 - Debian GNU/Linux 7.0 Phalcon Version 1.3.1
Sample Code:
- use Phalcon\Mvc\Model\Resultset\Simple as Resultset;
- $sql = "select * from users";
- $user = new Users();
- $ba = $user->getReadConnection()->query($sql);
- $ba->execute();
-
$result = $ba->fetchAll(\PDO::FETCH_ASSOC); -> In Windows and Linux $result works as expected. Returns an array of data from the database.
- $users = new Resultset(null, $user, $user->getReadConnection()->query($sql));
- $isvalid = $users->valid(); -> In Windows returns True. In Linux False
-
$quantity = $users->count(); -> In Windows AND Linux returns ā2ā. As expected.
- $data = array();
- foreach ($users as $info) -> In Windows the loop works as expected. In Linux the loop doesnt work.
- { $data[] = $info->name;}
Question:
When i create and instance of Resultset -> new Resultset(null, {Users}, {Phalcon\Db\Result\Pdo} ); Resultset only receive a Phalcon\Db\Result\Pdo parameter, which works ok in Windows and Linux (fetchAll works ok)
The object returned by Resultset contains a correct Count() message in Linux and Windows (Returns "2"). But a valid() = false in Linux and the $users variable doesnt loop through the foreach loop.
Is that a pdo_dblib bug? I dont know how to debug resultset/simple.c code.
Thanks in advance
Ramiro