SELECT a.*, b.`id_register` FROM `photos` a LEFT JOIN `albums` b ON (b.`id`=a.`id_album`) WHERE a.`id` =
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 '' at line 4