You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ORDER BY f.list
LIMIT 50' at line 9
SELECT
distinct f.path, f.name
FROM
files as f
LEFT JOIN objects_files as of on (of.id_file = f.id)
WHERE
of.id_object =
ORDER BY f.list
LIMIT 50
;