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 ''.https: AND `lipasmata_nt_comp`.buyer_id=`lipasmata_new_type`.buyer_id AND ' at line 3