Results 1 to 3 of 3

Thread: Is it possible to combine multiple arrays into one sorted array?

  1. #1
    Join Date
    Sep 2007
    Location
    Maui
    Posts
    642
    Thanks
    284
    Thanked 15 Times in 15 Posts

    Default Is it possible to combine multiple arrays into one sorted array?

    Or do you just do one SELECT with a really complex WHERE clause?

    Thanks.

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    What do you mean by this? Did you want to combine all this in PHP or in the WHERE clause.
    Jeremy | jfein.net

  3. #3
    Join Date
    Sep 2007
    Location
    Maui
    Posts
    642
    Thanks
    284
    Thanked 15 Times in 15 Posts

    Default

    I guess I am blurring the line between php and mySQL. Just want to know the "best practices" way to do this:

    Code:
    SELECT * FROM event WHERE startdate = $today;
    SELECT * FROM event WHERE event_id IN (SELECT event_id FROM recur WHERE dayofwk  = whatever the day of the week is)
    SELECT * FROM event WHERE event_id IN (SELECT event_id FROM recur WHERE something else)
    SELECT * FROM event WHERE event_id IN (SELECT event_id FROM recur WHERE something else)
    and display all results in one sorted list.
    Last edited by kuau; 07-26-2008 at 08:23 PM. Reason: forgot code tags

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •