I have 2 queries, I need the second to use the results from the first. Its a web based bus application using PHP&MYSQL.
the first query...
SELECT ROUTE_ID,COUNT(ROUTE_ID) AS numstops
AND (STOP_DESC='VAR1') OR STOP_DESC='VAR2')
GROUP BY roue_ID
HAVING numstops 2;
I need to store the resulting ROUTE_ID's for the second query...
AND stop_visit_time.ARRIVE_TIME>=#VAR3# AND ROUTE_ID IN (results from 1st query);
I am not sure how to do it, do I need to have a table in order to store these temp results (but this will mean only one user at a time and it is a web based application!)
or an array but how can MYSQL talk to it and incorporate it into the second query?
Thanks for the help.