NYCPHP Meetup

NYPHP.org

[nycphp-talk] getting my head around heirarchical structures

Allen Shaw ashaw at polymerdb.org
Sat Oct 29 00:39:32 EDT 2005


Yeah, this is going to be saved in the database to have on hand for 
later, part of a saved query setup.  And although the "buttload of 
fields" idea occurred to me, the idea here is that I have to design this 
to work even for tables that don't even exist yet.  Once a table or 
relational set of tables is offered for querying, the admin has to mark 
which columns are available, and then the user should be able to pick 
any of those columns to display in the query *and* define filters based 
on any combination of those available columns.

The more I think about this the more it seems like I'm on the right 
track with the recursive parent/child structure, but one thing that's 
giving me pause is that a parent record has no criteria of its own, and 
a child record has no boolean-type of its own; meaning I wind up with 
basically two types of records in this one table.  Still, normalizing 
beyond this point and trying to put those two types of records in two 
different tables seems just insanely and unnecessarily complicated. 
Um... right?

Roland Cozzolino wrote:
> Just curious, it this something that needs to be saved to the database 
> (sort of like saved queries a user can bring back)?  If not, you can do 
> this with sessions.  I am actually implementing something very similar 
> right now with open ended queries where we simply give the user a 
> buttload of fields to choose from including boolean options.  Since I 
> don't care about the query once it returns a result, I assemble it on 
> the fly and use DOM/DHTML and a bit of ajax to deal with the 
> addition/subtraction of query fields.  Not sure if this helps.
> 
> Allen Shaw wrote:
> 
> 
>>All this heirarchical structure talk happens to come up as I'm trying to 
>>implement a data filtering scheme for an ad-hoc querying interface.  
>>Basically I want to allow queries as complex as the user wants -- not 
>>just on one or two fields at a time -- so this has to be open-ended, and 
>>it seems to be pointing me to a heirarchical structure.  I think I've 
 >>...

-- 
Allen Shaw
Polymer (http://polymerdb.org)



More information about the talk mailing list