Trying to run some SQL with no luck, trying to select data from two tables where a condition is true.
The tables are driver_details and locations. Both tables have the column user_id, and I want to get data from both based on the matched user_id from the between part. (that select statement works and returns ID's);
SELECT driver_details.firstName,
locations.lat,
locations.lng
FROM driver_details
INNER JOIN locations
WHERE user_id =
(SELECT user_id FROM locations WHERE
(lat BETWEEN 0 AND 5) AND
(lng BETWEEN 0 AND 5))
I am getting the error: Fatal error: Call to a member function bind_param() on a non-object in C:\xampp\htdocs\vector\www\scripts\getDriversInRange.php on line 33