[FX.php List] How to combine two sets of query results

Jonathan Schwartz jschwartz at exit445.com
Sat Sep 6 08:36:25 MDT 2008


Morning Bob.

Hope you are staying dry in the hurricane today.

Isn't this simply where you would add two arrays?

There is an array merge function: 
http://us.php.net/manual/en/function.array-merge.php

But I'm guess that perhaps a simple arraycombined = array1.array2 
might wrk.  Not sure if that can be done.

Jonathan

At 9:16 AM -0500 9/6/08, Bob Patin wrote:
>I have 2 query results sets--logResult and log2Result.
>
>Is there an easy way to combine these two before I parse, massage, 
>and display these result sets?
>
>What I'd like is to be able to combine these two into something like 
>"log3Result" so that I can use my existing FOREACH loop on queries 
>from 2 different databases at the same time. Because of the nature 
>of the display, I have to sort the query results before the FOREACH 
>loop starts; each of the 2 queries are already sorted, but what I'd 
>*really* like to do is
>
>do query 1
>
>do query 2
>
>combine query 1 with query 2 into 1 resultset
>
>sort combined resultset
>
>run my loop
>
>If anyone can guide me on the right way to do this, I'd be most grateful.
>
>Thanks,
>
>Bob Patin
>Longterm Solutions
>bob at longtermsolutions.com
>615-333-6858
>http://www.longtermsolutions.com
>iChat: bobpatin
>AIM: longterm1954
>FileMaker 9 Certified Developer
>Member of FileMaker Business Alliance and FileMaker TechNet
>--------------------------
>FileMaker hosting and consulting for all versions of FileMaker
>PHP * Full email services * Free DNS hosting * Colocation * Consulting
>
>_______________________________________________
>FX.php_List mailing list
>FX.php_List at mail.iviking.org
>http://www.iviking.org/mailman/listinfo/fx.php_list


-- 
Jonathan Schwartz
Exit 445 Group
jonathan at exit445.com
http://www.exit445.com
415-370-5011


More information about the FX.php_List mailing list