There was a problem querying the DB. SELECT id FROM ( SELECT id FROM chunks_v2 WHERE user_id = AND valid_upload = 1 ) collection - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND valid_upload = 1 ) collection' at line 1