[FX.php List] Combine two sets of search results into one table?

Dale Bengston dale.bengston at gmail.com
Fri Jul 20 13:20:15 MDT 2012


There are some examples in the comments of PHP's sort function. (That's where I found mine!)

Dale

http://us2.php.net/manual/en/function.sort.php


On Jul 20, 2012, at 2:03 PM, Denis Somar wrote:

> I definitely want to merge the arrays as these are going to be sorted by date not by type.  I'm gathering what I should be doing is using array_merge in PHP.
> 
> But even if I do perform array_merge, the FOR loop will essentially just see the first part of the array from one table and the next half of the array, so I'll likely also have to do some array sorting beforehand, right?
> 
> Thanks again for the help!  Any snippets out there btw?
> 
> Best,
> Denis
> 
> 
> 
> On Fri, Jul 20, 2012 at 1:20 PM, Dale Bengston <dale.bengston at gmail.com> wrote:
> Yes! Absolutely you can just tack the second set of results to the first with another foreach loop. Merging arrays will give you better control over knitting the results (re-sorting, for example) if that's desired. If not, go easy!
> 
> Dale
> 
> On Jul 20, 2012, at 9:50 AM, BEVERLY VOTH wrote:
> 
> > Denis, you can merge the arrays with PHP
> >
> > OR
> > you can just make one table and put these together on output (that is, if you don't need to merge them in some other way with sorts, etc.)
> >
> > TABLE
> >       foreach (first query results) {
> >               TR..
> >       }
> >       foreach (second query results) {
> >               TR..
> >       }
> > /TABLE
> >
> > Beverly
> >
> > On 20 Jul 2012, at 10:00 AM, Denis Somar wrote:
> >
> >> This is just for outputs sake.  I have two tables Requests and Quotes and rather than displaying two separate tables with results I was trying to determine if I could show query results from each table in one combined HTML table
> >
> > _______________________________________________
> > FX.php_List mailing list
> > FX.php_List at mail.iviking.org
> > http://www.iviking.org/mailman/listinfo/fx.php_list
> 
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
> 
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20120720/a2acc919/attachment.html


More information about the FX.php_List mailing list