I have followed the zend instructions for implement my web Authentication using a database table with Mysqli driver configured.
When render the page, the following exceptions appears after execute authenticate method:
Zend\Db\Adapter\Exception\ErrorException
File:
C:\xampp\htdocs\pfc\vendor\ZF2\library\Zend\Db\Adapter\Driver\Mysqli\Statement.php:188
Mensaje:
Commands out of sync; you can't run this command now
It seems to be that it happen because the driver don't can execute multiples querys without free the results of the previous query first (multiquery problem).
I discovered that if changed the driver of the dbAdapter to pdo_mysql, authenticate method works ok. But I don't want use PDO drivers by performance reasons.
How I configure the Mysqli driver for can do it?
My code bellow:
$dbAdapter = new DbAdapter(array(
//'driver' => 'Mysqli', //This driver fail when call authenticate method
'driver' => 'Pdo_Mysql', //This driver works ok
'database' => 'securedraw',
'username' => 'root',
'password' => ''
));
$authAdapter = new AuthDbTableAdapter($dbAdapter);
$authAdapter->setTableName('users')
->setIdentityColumn('mail')
->setCredentialColumn('password')
->setIdentity('josep')
->setCredential('josep');
$authResult = $authAdapter->authenticate(); //Method fail