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 'AND books_typ != 5 AND books_statustext LIKE 'lieferbar' ORDER BY books_erschein' at line 1: SELECT books_id, books_titel, books_slug, books_utitel, books_autor, books_hg, SUBSTRING(books_zum_Buch,1,300) AS zum_buch, books_cover_img FROM books WHERE books_kategorie = AND books_typ != 5 AND books_statustext LIKE 'lieferbar' ORDER BY books_erscheint DESC