Hej.
Jeg har et lille problem - jeg får fejlen:
Der opstod en fejl i erklæringen.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 'WHERE post_by = ? ORDER BY topic_id DESC LIMIT 1' at line 1
Koden er:
if ($stmt = $mysqli->prepare('SELECT topics.topic_id,topics.topic_subject,topics.topic_date,topics.topic_cat,topics.images,posts.post_content FROM topics LEFT JOIN posts ON posts.post_topic = topics.topic_id WHERE topic_page_cat = ? AND WHERE post_by = ? ORDER BY topic_id DESC LIMIT 1')) {
Så hvis jeg fjerner AND WHERE post_by = ?, får jeg et udput, men selvfølgelig et forkert et.
Hvad er det jeg gør forkert?
På forhånd tak for hjælpen