SQL ERROR: 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 'and gallery.GalleryID=gallery_website.GalleryID and gallery.PubcategoryID=pub...' at line 1


Query:
select gallery_website.WebsiteDirectory, gallery.Directory, publication.PublicationURL, pubcategory.PubcategoryDirectory, publication.PublicationRootDirectory, publication.PublicationDirectory from pubcategory, publication, gallery, gallery_website where gallery.GalleryID= and gallery.GalleryID=gallery_website.GalleryID and gallery.PubcategoryID=pubcategory.PubcategoryID and gallery.PublicationID=publication.PublicationID