hi can you help me with this join please..
I have to tables locations and plays, i want to
SELECT * FROM locations WHERE the user has not played today, remaining > 0 and update < 10 mins ago.
i wrote this below, but it doesnt work!
$destination = $db->fetchRow('SELECT l.* FROM locations l
LEFT JOIN plays p ON l.object_id = p.object_id AND p.username = ?
WHERE p.object_id IS NULL AND l.remaining > ? AND l.update > ? ORDER BY RAND() LIMIT 1', array($_POST['username'], '0', time()-600)) ;
Any help will be much appreciated
Thanks