On 19.11.2007, at 21:09, Hans-Peter Oeri wrote:

FETCH_2D is the "core" of my proposal. It's like the
ATTR_FETCH_TABLE_NAMES, enhanced in arrays. Columns are to be found on
the second level:
$result[tablename][columname]


Not sure how real world useful this is. What I have seen more is a need to build tree style structures. This would require knowing the FK's or allowing the user to specify the tree structure they want. This sort of thing is supported by C#'s LINQ.

Columns that don't result from a table are added to a "null base" (work
title). The default "null base" is the first level array:
$result[computedcolumn]

The connection attribute ATTR_2D_NULLBASE (work title) defines an
alternative "null base":
$result[nullbase][computedcolumn]

Why not use an empty string aka null casted to a string. That way you will never run into a situation where someone has called their table "nullbase". It will also make it immediatly clear to anyone that this array key is special.

regards,
Lukas

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to