SELECT COUNT(id) FROM (SELECT ogl.id, ogl.ident, ogl.title, ogl.category, ogl.city, ogl.state, ogl.country, ogl.cost, ogl.cost_max, ogl.cost_notice, ogl.cost_currency, ogl.for_free, ogl.status, ogl.display, ogl.forever, ogl.urgent, ogl.create_date, ogl.whole_country, DATEDIFF(CURDATE(), ogl.create_date) AS 'datediff', comp.company_name, professions.name AS profession_name, ogl.lat, ogl.lng, ogl.cost_tax, ogl.company_id, ogl.text, cats.words_suggestion, MAX(CASE WHEN pay.pay_type = 'VIEW' THEN pay.pay_expire ELSE NULL END) AS view_till, MAX(CASE WHEN pay.pay_type = 'PROMOTED' THEN pay.pay_expire ELSE NULL END) AS promoted_till FROM oglo2023_announcement AS ogl LEFT JOIN oglo2023_announcement_category_pl AS cats ON (ogl.category = cats.id) LEFT JOIN oglo2023_company AS comp ON comp.company_id = ogl.company_id LEFT JOIN oglo2023_announcement_payments AS pay ON pay.pay_ident = ogl.ident AND pay.pay_expire >= '2026-06-28' AND pay.pay_create <= '2026-06-28' WHERE ogl.status = 'ACCEPT' AND ogl.display = 'TRUE' AND (pay.pay_ident IS NOT NULL OR ogl.forever = 'TRUE') AND ( (ogl.title LIKE '%lekarz%' OR cats.words_suggestion LIKE '%lekarz%') OR comp.company_name LIKE '%lekarz%' OR professions.name LIKE '%lekarz%') GROUP BY ogl.id ) AS x Caught exception: Unknown column 'professions.name' in 'field list' array(5) { [0]=> array(5) { ["file"]=> string(64) "/home/users/opengo/public_html/opraca.pl/classes/mysql.class.php" ["line"]=> int(291) ["function"]=> string(7) "doQuery" ["class"]=> string(5) "MySQL" ["type"]=> string(2) "->" } [1]=> array(5) { ["file"]=> string(64) "/home/users/opengo/public_html/opraca.pl/classes/mysql.class.php" ["line"]=> int(635) ["function"]=> string(8) "sqlQuery" ["class"]=> string(5) "MySQL" ["type"]=> string(2) "->" } [2]=> array(5) { ["file"]=> string(65) "/home/users/opengo/public_html/opraca.pl/classes/avatec.class.php" ["line"]=> int(577) ["function"]=> string(14) "sqlCountSimple" ["class"]=> string(5) "MySQL" ["type"]=> string(2) "->" } [3]=> array(5) { ["file"]=> string(84) "/home/users/opengo/public_html/opraca.pl/modules/announcement/announcement.class.php" ["line"]=> int(2570) ["function"]=> string(8) "paginate" ["class"]=> string(6) "kernel" ["type"]=> string(2) "->" } [4]=> array(5) { ["file"]=> string(78) "/home/users/opengo/public_html/opraca.pl/modules/announcement/announcement.php" ["line"]=> int(252) ["function"]=> string(30) "userSearchAnnouncementStandard" ["class"]=> string(12) "Announcement" ["type"]=> string(2) "->" } }