Hello everyone,
I started to use zend-db
to query a PostgreSQL database ; it obviously works fine but I’m a bit confused with the ResultSet
interface.
No matter what datatype my columns are in the database, it always returns a “string”.
Here is an example of my query :
$sql = new Sql($adapter, $config['postgresql']['table']);
$select = $sql->select();
$select->columns([
'status',
'count' => new Expression('COUNT(*)'),
]);
$select->group([
'status',
]);
$qsz = $sql->buildSqlString($select);
$statitics = $adapter->query($qsz, $adapter::QUERY_MODE_EXECUTE);
No matter what I do, I receive status
and count
as string but they are both integer !
I guess I missed something and would need some help to figure out how to receive it with the correct datatype.
Thanks a lot