Error in query: SELECT A.txt_titulo, A.txt_comentario, A.txt_format, A.txt_gal, A.txt_autoria, A.txt_fonte, B.img_file, B.img_desc FROM bsi_texto A LEFT JOIN bsi_textimg B ON A.txt_id = B.txt_id WHERE A.txt_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 2