I have setup zf2 DB adapter for mysqli, using the below configuration:
'db' => array(
'driver' => 'Mysqli',
'database' => 'db_name',
),
'service_manager' => array(
'factories' => array(
'Zend\Db\Adapter\Adapter'
=> 'Zend\Db\Adapter\AdapterServiceFactory',
),
'aliases' => array(
'db' => 'Zend\Db\Adapter\Adapter',
),
),
and using below code to create the connection:
$sm = $this->getServiceLocator();
$this->adapter = $sm->get('db');
The connection works and I can query database, my problem is that I am getting 'Zend\Db\Adapter\Driver\Mysqli\Result' instead of a resultset object which I want.
Thanks in advance
EDIT:
code used for querying DB:
$this->adapter->query("SELECT * FROM `users`")->execute();
The code above returns a Zend\Db\Adapter\Driver\Mysqli\Result object