I have the follow query I'm making to a MySQL database, for a Wordpress website:
global $wpdb;
/*get time slots*/
$query = "
SELECT DISTINCT routes.route_date, time_slots.name, time_slots.openings, time_slots.appointments
FROM routes
INNER JOIN time_slots ON routes.route_id = time_slots.route_id
WHERE route_date
BETWEEN 20140110
AND 20140227
ORDER BY route_date, name
";
$time_slots = $wpdb->query($query);
However the value of $time_slots is 245. Just a number. I don't know why. When I make the query in phpmyadmin, using the exact query, I get the expected results.
What am I doing wrong here and how can I get the array I'm expecting.
[database-query]. It is entirely unnecessary. We already have tags to cover the concept of database queries. Your question already has those tags.