Explorar el Código

[ZF-8380] Zend_Db_Adapter_Abstract: add method to fetch key-record pairs
- Attached adjustments to the documentation for $db->fetchAssoc to try to make it clearer


git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@21080 44c647ce-9c0f-0410-b52a-842ac1e357ba

tech13 hace 16 años
padre
commit
f7e27e078c
Se han modificado 1 ficheros con 4 adiciones y 3 borrados
  1. 4 3
      documentation/manual/en/module_specs/Zend_Db_Adapter.xml

+ 4 - 3
documentation/manual/en/module_specs/Zend_Db_Adapter.xml

@@ -786,7 +786,7 @@ echo $result[0]->bug_description;
             <para>
                 The <methodname>fetchAssoc()</methodname> method returns data in an array
                 of associative arrays, regardless of what value you have set
-                for the fetch mode.
+                for the fetch mode, using the first column as the array index.
             </para>
 
             <example id="zend.db.adapter.select.fetchassoc.example">
@@ -795,10 +795,11 @@ echo $result[0]->bug_description;
                 <programlisting language="php"><![CDATA[
 $db->setFetchMode(Zend_Db::FETCH_OBJ);
 
-$result = $db->fetchAssoc('SELECT * FROM bugs WHERE bug_id = ?', 2);
+$result = $db->fetchAssoc('SELECT bug_id, bug_description, bug_status FROM bugs');
 
 // $result is an array of associative arrays, in spite of the fetch mode
-echo $result[0]['bug_description'];
+echo $result[2]['bug_description']; // Description of Bug #2
+echo $result[1]['bug_description']; // Description of Bug #1
 ]]></programlisting>
             </example>
         </sect3>