Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:33473 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 69067 invoked by uid 1010); 27 Nov 2007 20:16:33 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 69052 invoked from network); 27 Nov 2007 20:16:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Nov 2007 20:16:32 -0000 X-Host-Fingerprint: 84.75.68.140 84-75-68-140.dclient.hispeed.ch Received: from [84.75.68.140] ([84.75.68.140:16905] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 09/B6-25304-F1B7C474 for ; Tue, 27 Nov 2007 15:16:32 -0500 To: internals@lists.php.net,Wez Furlong Message-ID: <474C7B1F.5070706@oeri.ch> Date: Tue, 27 Nov 2007 21:16:31 +0100 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.0 MIME-Version: 1.0 References: <40.30.64829.53898474@pb1.pair.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Posted-By: 84.75.68.140 Subject: Re: [PHP-DEV] [patch] PDO_FETCH_KEYS From: hp@oeri.ch (Hans-Peter Oeri) Hi! Wez Furlong wrote: > What purpose does this serve exactly? PDO::FETCH_KEYS is supposed to be a "generalized" form of the existing PDO::FETCH_KEY_PAIR. The latter is limited to two column results and organises it into key=>value. PDO::FETCH_2D is an IMHO better strategy than the existing ATTR_FETCH_TABLE_NAMES. The latter includes two "information tokens" into one datum (the array index). > Why do we need to allocate an empty string for every database connection? The empty string is the default value for the attribute. NULL actually has a different meaning. Of course, the actual implementation of a default value is open for change, of course. > Why do we need this in the core? > There's a lot of manipulation being done here that is better suited to > happen in PHP script land where it's safer and easier to maintain. PDO::FETCH_2D is *NOT* easily implemented in PHP as it needs information unavailable before. PDO::FETCH_KEYS is just a generalization of the existing PDO::FETCH_KEY_PAIR. What do you mean by "manipulation"? I only intended to implement fetch modes I need. HPO PS: Please notice the updated patch.