http://www.php.net/array_filter
I went there at first for my information on filtering mySQL query results
using PHP, to no
avail.
This is more of a Vignette construct (my native environment) so bear with
me. I decided the
easiest course of action to tackle a perplexing problem involving two
queries and having to
display them in a certain customized manner:
Query 1
1 - 1 billion rows (who knows!), with field 'iref'
Query 2
1 - [infinity] rows (who knows!), with field 'iref'
the queries are based upon the concept that Query1.iref = Query2.iref and
that Query1 has
a one-to-many relationship with Query2, based on iref.
I am tasked with displaying in a report one row from Query1 and all
subsequent rows from
Query2 (which are "grouped" by iref for ease sake) where Query1.iref =
Query2.iref.
Problem is, I am having to use embedded WHILE loops to parse through the
queries and produce
my results, which is a horrific performance problem and the client is
way-not-happy about
that. Furthermore, I would have to do individual Query2 queries solely
based upon iref, which
means countless hundreds of db entry calls on a single query, still having
to parse inside
embedded WHILE loops. WORSE performance hog.
So I remember from my Vignette days a TCL proc written by VPS professionals
called FILTER
which would filter through the query resultset and only produce the
rows/cols where a col
field value = $fieldValue and that would make life a breeze.
But PHP alas has nothing like that, unless someone else can point me to a
direction where
I can find just that. I tried writing my own and I don't even know the
logic as to how to
imagine how to create my own FILTER.
Thanx
Phil