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

From: Date: Fri, 30 Jul 2004 18:06:55 +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-4693@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 User updated by: jon at latchkey dot 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: I'm curious why you would refuse (with a WONT FIX) to add examples to the online documentation to make things more clear. Previous Comments: ------------------------------------------------------------------------ [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 ------------------------------------------------------------------------ [2004-07-30 12:59:39] danielc at analysisandsolutions dot com DB_FETCHMODE_ASSOC ------------------------------------------------------------------------ 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 (#4693) next »