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 '' at line 6

SELECT *, REPLACE(REPLACE(REPLACE(image0, '..', '#'), '.', '_mini.'), '#', '..') AS 'image0_mini', REPLACE(REPLACE(REPLACE(image1, '..', '#'), '.', '_mini.'), '#', '..') AS 'image1_mini', REPLACE(REPLACE(REPLACE(image2, '..', '#'), '.', '_mini.'), '#', '..') AS 'image2_mini' FROM companies WHERE id =
-----