zendframework/zend-db

Zend DB SQLSRV: Prepared params not working

Closed this issue · 4 comments

Hello, Zend Select with SQLSRV is only working with this method:
$this->tableGateway->select(array("Personalnummer = $personalnumber"));

With the other method
$this->tableGateway->select(array("Personalnummer" => $personalnumber));
is it not working.

Please add the second method to the code like its written in the Tutorial:
https://framework.zend.com/manual/2.4/en/user-guide/skeleton-application.html

@ezimuel or @alextech
Can you confirm this problem?

@minimaex what is your connection driver? PHP supports parameterized queries only through PDO. Therefore, to get array("Personalnummer" => $personalnumber) to work, you need to have configuration driver key be pdo_sqlsrv. Sounds like you have 'driver' => 'Sqlsrv'

It was Sqlsrv, thank you its working now! :)