Re: Array Question
| From: | skate | Date: | Tue, 01 Apr 2003 17:02:20 +0000 |
| Subject: | Re: Array Question | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-141845@lists.php.net to get a copy of this message | ||
look into things like JOIN and SORT BY in MySQL, they're quicker and more efficient than PHP
for doing DB stuff (so i'm told)
took me awhile to get my head around JOIN, but once you've got it, you'll never be without
it ;)
"Mark McCulligh" <mmcculli@sykescanada.com> wrote in message news:20030401165836.4406.qmail@pb1.pair.com...
> I have two tables that I want to display together as if they were one table
> and order them by a common date field.
>
> Because I am using MySQL I can't use the usually way I would do this. Create
> a store procedure or view.
>
> I was thinking of creating two separate queries in PHP then loading the data
> into one Array. In short loop though both tables copying the records into an
> array.
>
> Then I was going to sort the Array my a common date field. Then of course
> loop through printing the Array.
>
> My question is: Is this the best way to do this or is there another way.
> Also how can you sort an Array by one date field.
>
> Any ideas on how to do link two tables together and sort my a common date
> field.
>
> Thanks,
> Mark.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>