Thanks a lot!

Kirill Balyasnikov

Bill Karwin пишет:
The workaround you can use now is to write a loop to fetch(), and in the 
fetch() method you can specify the fetch mode:

  $stmt = $connection->query($queryString, $bindArray);
  while ($data[] = $stmt->fetch(PDO::FETCH_ASSOC)) { }

I have logged JIRA issue http://framework.zend.com/issues/browse/ZF-1428

Regards,
Bill Karwin
-----Original Message-----
From: Кирилл Балясников [mailto:[EMAIL PROTECTED] Sent: Thursday, May 24, 2007 7:15 AM
To: [email protected]
Subject: [fw-general] Zend_Db fetch mode issue

Why is it not possible to specify fetch mode directly in method calls such as:

$connection->fetchAll($queryString, $bindArray, PDO::FETCH_ASSOC);

It's not very convinient to call setFetchMode and getFetchMode before and after the call to restore previous state.

For example i have 10 methods in different classes and sometimes i need to get results as numeric array and sometimes as assoc array. So to be sure everything is working ok i have to setFetchMode before every fetchXXX call.

I have no rights to create new issues in issue tracker so may be somebody wants to post it there? ;)

Regards,
Kirill Balyasnikov


Reply via email to