A Database Error Occurred

Error Number: 1064

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 'OR torah.TorahID IN(select PostID from postsubcategory where SubCategoryID = ...' at line 6

SELECT torah.TorahTitle as PostTitle, torah.TorahSlug as PostSlug, torah.TorahContent as PostSummery, IF(torah.Image IS NULL or torah.Image = '', 'default/DefaultImage_WeeklyPerasha.png', torah.Image) as Image, torah.PublishedDate as PostDate, `users`.`FirstName`, `users`.`LastName`, `authors`.`AuthorId`, `authors`.`AuthorTitle`, `authors`.`AuthorImage`, `authors`.`AuthorFirstName`, `authors`.`AuthorLastName`, `authors`.`AuthorBio`, `authors`.`AuthorWebsite`, `authors`.`AuthorPhone`, `authors`.`AuthorEmail` FROM `torah` JOIN `authors` ON `torah`.`Author` = `authors`.`AuthorId` LEFT JOIN `users` ON `torah`.`UserID` = `users`.`UserID` WHERE `torah`.`PublishedDate` <= '2024-03-19 07:24:23' AND (`torah`.`CategoryID` = OR torah.TorahID IN(select PostID from postsubcategory where SubCategoryID = AND SectionID = 14)) AND `torah`.`Status` = 1 ORDER BY `torah`.`TorahID` DESC

Filename: models/Home_model.php

Line Number: 1357