Newsgroups: php.internals,php.internals Path: news.php.net Xref: news.php.net php.internals:33355 php.internals:33356 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 50952 invoked by uid 1010); 20 Nov 2007 09:02:19 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 50937 invoked from network); 20 Nov 2007 09:02:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Nov 2007 09:02:19 -0000 X-Host-Fingerprint: 194.230.72.250 unknown Received: from [194.230.72.250] ([194.230.72.250:6985] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7F/94-22278-A92A2474 for ; Tue, 20 Nov 2007 04:02:19 -0500 To: internals@lists.php.net,Lukas Kahwe Smith Message-ID: <4742A299.2080107@oeri.ch> Date: Tue, 20 Nov 2007 10:02:17 +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 CC: PHP Developers Mailing List References: <3E.97.05823.18DE1474@pb1.pair.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Posted-By: 194.230.72.250 Subject: Re: [PHP-DEV] [PATCH] PDO::FETCH_2D From: hp@oeri.ch (Hans-Peter Oeri) Hi! Thanks for your response! Lukas Kahwe Smith wrote: >> Not sure how real world useful this is. What I have seen more is a I often run into a situation like the following: We need a "framework like" class to change *joined* tables. The framework itself has no inherent knowledge about table fields, but (anyhow) loads table definitions. This functionality is useful for: a) duplicate field names in different tables (FETCH_NAMED does not help) b) update tables, as - without any additional work - I have the fields "by table" Access to fields w/o knowing their table is possible by combining FETCH_2D with FETCH_ASSOC or FETCH_NUM. As that creates references, changes to "table-less" fields are represented in the "table" fields automagically ;) I don't know how often, but in "my" real world, that's bloody useful. But at least much more useful than the existing ATTR.FETCH_TABLE_NAMES... As for "empty string" index: In my proposal, you could: setAttribute( PDO::ATTR_2D_NULLBASE, '') Would your really like to *fix* it to that? > like I said ideally PDO would know about FKs and use those to build the > tree structure automagically. Any added *functionality* (defined by: PDO *knows*) must be sincerely discussed, I think. My proposal only adds a way to return fetched data - PDO does not *know* anything more. > I would like to see: > 1) lazy connect > 2) driver independent DSN support Please bear with me - I'm not a practiced coder. I'm sure my humble proposal contains many bugs... But why lazy connects? As for DSN: Has anybody discussed including username/password into the DSN? mysql:username:password@dbname=... HPO