I'm looking to get todays last 10 locations from my database for each driver (authentication_id). But have had to write two separate queries, the latter using the resultset of the former. How could I write it as a single query?
SELECT DISTINCT authentication_id FROM gps_trak WHERE DATE(location_timestamp) = DATE(NOW())
loop the resultset for each $authID...
SELECT latitude, longitude FROM gps_trak WHERE authentication_id = ".$authID." ORDER BY location_timestamp DESC LIMIT 10";
Is it possible?