SQL Error: 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 'טים ודיגיטל', 50, 0)) AS `relevant` FROM `sites` INNER J' at line 1 In query: SELECT `sites`.`siteId`,`sites`.`siteName`,`sites`.`siteDes`,`sites`.`siteUrl`,`sites`.`realLink`, `topics`.`topicName`,`topics`.`topicId`,`topics`.`topicDes`, (IF(`topics`.`topicName` = 'גאדג'טים ודיגיטל', 50, 0)) AS `relevant` FROM `sites` INNER JOIN `site2topic` ON `sites`.`siteId` = `site2topic`.`siteId` AND `sites`.`status` = 'מאושר' INNER JOIN `topics` ON `site2topic`.`topicId` = `topics`.`topicId` INNER JOIN `categories` ON `topics`.`catId` = `categories`.`catId` HAVING `relevant` > 0 ORDER BY `relevant` DESC,`topics`.`topicName`,`sites`.`siteName`;