I love this, since I do not have to type [' and '] at the end of each field. Typing -> is easier!
$db = Zend_Registry::get('db'); $db->setFetchMode(Zend_Db::FETCH_OBJ); $result = $db->fetchAll("SELECT * FROM user_roles"); foreach($result AS $row) { echo $row->fieldA; //instead of the usual $row['fieldA'] echo $row->fieldB; //instead of the usual $row['fieldA'] } |
This is also documented in my wiki.