Req #1998 [WFx]: please include this example in the online documentation

From: Date: Fri, 30 Jul 2004 18:35:14 +0000
Subject: Req #1998 [WFx]: please include this example in the online documentation
References: 1  Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-4694@lists.php.net to get a copy of this message
Edit report at http://pear.php.net/bugs/bug.php?id=1998&edit=1 ID: 1998 Updated by: danielc@analysisandsolutions.com Reported By: jon at latchkey dot com Status: Wont fix Type: Feature/Change Request Package: Documentation PHP Version: Irrelevant Assigned To: danielc New Comment: While the documentation at http://pear.php.net/manual/en/package.database.db.db-common.getassoc.php is complex because it covers all of the potential options, it does indeed clearly cover all of the options. The text in the getAssoc() docblock doesn't go into that level of detail. If you feel you can clarify the existing documentation, keeping in mind that it must use one result set and cover all of the potential options, please provide a unified diff against http://cvs.php.net/peardoc/en/package/database/db/db-common/getassoc.xml Previous Comments: ------------------------------------------------------------------------ [2004-07-30 14:06:55] jon at latchkey dot com I'm curious why you would refuse (with a WONT FIX) to add examples to the online documentation to make things more clear. ------------------------------------------------------------------------ [2004-07-30 14:03:20] danielc at analysisandsolutions dot com Sorry about the mistaken DB_FETCHMODE_ASSOC comment. The getAssoc() documentation provides real world examples of how a given result set would come out using each option. The suggested wording doesn't perform that task. [Note: The bug was originally submitted with the summary of "DB_FETCHMODE_PRIMARY_KEY," which was a PEAR::DB feature request. The user then changed subject to "please include this example in the online documentation." I'm now changing the Pakcage to "Documentation."] ------------------------------------------------------------------------ [2004-07-30 13:36:38] jon at latchkey dot com Ah ha! it is getAssoc() that does the trick. The online documentation for getAssoc() is far more confusing than the phpdoc documentation in the code. * For example, if the table "mytable" contains: * * <pre> * ID TEXT DATE * -------------------------------- * 1 'one' 944679408 * 2 'two' 944679408 * 3 'three' 944679408 * </pre> * * Then the call getAssoc('SELECT id,text FROM mytable') returns: * <pre> * array( * '1' => 'one', * '2' => 'two', * '3' => 'three', * ) * </pre> * * ...while the call getAssoc('SELECT id,text,date FROM mytable') returns: * <pre> * array( * '1' => array('one', '944679408'), * '2' => array('two', '944679408'), * '3' => array('three', '944679408') * ) * </pre> ------------------------------------------------------------------------ [2004-07-30 13:27:27] jon at latchkey dot com By the way, if you are willing to accept the patch, I will even write the code for you. Just let me know. ------------------------------------------------------------------------ [2004-07-30 13:10:32] jon at latchkey dot com Hi Daniel, Please actually read what I write and we will stop wasting each others time. According to the documentation, it says: DB_FETCHMODE_ASSOC Array ( [a] => 28 [b] => hi ) That is the 'COLUMN NAME' as the array key. I'm specifically asking for the 'PRIMARY KEY VALUE' to be the array key. jon ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://pear.php.net/bugs/bug.php?id=1998 -- Edit this bug report at http://pear.php.net/bugs/bug.php?id=1998&edit=1

« previous php.pear.doc (#4694) next »