PDA

View Full Version : Is it possible to combine multiple arrays into one sorted array?



kuau
07-24-2008, 11:15 PM
Or do you just do one SELECT with a really complex WHERE clause?

Thanks.

Nile
07-24-2008, 11:17 PM
What do you mean by this? Did you want to combine all this in PHP or in the WHERE clause.

kuau
07-26-2008, 08:19 PM
I guess I am blurring the line between php and mySQL. Just want to know the "best practices" way to do this:


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.