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 '= '' AND referencia.aktiv = '1' AND referencia_eng.a' at line 23

SELECT DISTINCT referencia.id AS id, referencia_eng.nev AS nev, referencia_eng.dirgen AS dirgen, referencia.priority AS priority, terulet_eng.nev AS terulet, files.galeria AS galeria, files.id AS file FROM _referencia LEFT JOIN referencia_eng ON referencia_eng.id = _referencia.referencia LEFT JOIN referencia ON referencia.id = _referencia.referencia LEFT JOIN terulet_referencia ON terulet_referencia.referencia = referencia.id LEFT JOIN terulet_eng ON terulet_eng.id = terulet_referencia.terulet LEFT JOIN files ON files.galeria = referencia.galeria AND files.ae = '1' AND files.filetipus = '1' WHERE _referencia. = '' AND referencia.aktiv = '1' AND referencia_eng.active = '1' ORDER BY IF(files.galeria>0,1,0) DESC, referencia_eng.nev

Code path:
0 -> Array
_ _file -> /home/adminis3/public_html/vardom/system/mysql.php
_ _line -> 37
_ _function -> error_report
_ _args -> Array
_ _ _ _0 -> SELECT DISTINCT referencia.id AS id, referencia_eng.nev AS nev, referencia_eng.dirgen AS dirgen, referencia.priority AS priority, terulet_eng.nev AS terulet, files.galeria AS galeria, files.id AS file FROM _referencia LEFT JOIN referencia_eng ON referencia_eng.id = _referencia.referencia LEFT JOIN referencia ON referencia.id = _referencia.referencia LEFT JOIN terulet_referencia ON terulet_referencia.referencia = referencia.id LEFT JOIN terulet_eng ON terulet_eng.id = terulet_referencia.terulet LEFT JOIN files ON files.galeria = referencia.galeria AND files.ae = '1' AND files.filetipus = '1' WHERE _referencia. = '' AND referencia.aktiv = '1' AND referencia_eng.active = '1' ORDER BY IF(files.galeria>0,1,0) DESC, referencia_eng.nev
_ _ _ _1 -> Resource id #5
1 -> Array
_ _file -> /home/adminis3/public_html/vardom/includes/catalog.php
_ _line -> 152
_ _function -> sql_query
_ _args -> Array
_ _ _ _0 -> SELECT DISTINCT referencia.id AS id, referencia_eng.nev AS nev, referencia_eng.dirgen AS dirgen, referencia.priority AS priority, terulet_eng.nev AS terulet, files.galeria AS galeria, files.id AS file FROM _referencia LEFT JOIN referencia_eng ON referencia_eng.id = _referencia.referencia LEFT JOIN referencia ON referencia.id = _referencia.referencia LEFT JOIN terulet_referencia ON terulet_referencia.referencia = referencia.id LEFT JOIN terulet_eng ON terulet_eng.id = terulet_referencia.terulet LEFT JOIN files ON files.galeria = referencia.galeria AND files.ae = '1' AND files.filetipus = '1' WHERE _referencia. = '' AND referencia.aktiv = '1' AND referencia_eng.active = '1' ORDER BY IF(files.galeria>0,1,0) DESC, referencia_eng.nev
_ _ _ _1 -> Resource id #5
2 -> Array
_ _file -> /home/adminis3/public_html/vardom/includes/kereso.php
_ _line -> 129
_ _args -> Array
_ _ _ _0 -> /home/adminis3/public_html/vardom/includes/catalog.php
_ _function -> include
3 -> Array
_ _file -> /home/adminis3/public_html/vardom/includes/main.php
_ _line -> 144
_ _args -> Array
_ _ _ _0 -> /home/adminis3/public_html/vardom/includes/kereso.php
_ _function -> include
4 -> Array
_ _file -> /home/adminis3/public_html/vardom/index.php
_ _line -> 115
_ _args -> Array
_ _ _ _0 -> /home/adminis3/public_html/vardom/includes/main.php
_ _function -> include

Parameters:
dir -> profile
lang -> eng
page -> 18
id -> 0
ref -> gap-plot-utilization-by-constructing-an-apartment-house-erkel-str-14-a/
p -> 0

Files:
Array ( [query_string] => SELECT DISTINCT referencia.id AS id, referencia_eng.nev AS nev, referencia_eng.dirgen AS dirgen, referencia.priority AS priority, terulet_eng.nev AS terulet, files.galeria AS galeria, files.id AS file FROM _referencia LEFT JOIN referencia_eng ON referencia_eng.id = _referencia.referencia LEFT JOIN referencia ON referencia.id = _referencia.referencia LEFT JOIN terulet_referencia ON terulet_referencia.referencia = referencia.id LEFT JOIN terulet_eng ON terulet_eng.id = terulet_referencia.terulet LEFT JOIN files ON files.galeria = referencia.galeria AND files.ae = '1' AND files.filetipus = '1' WHERE _referencia. = '' AND referencia.aktiv = '1' AND referencia_eng.active = '1' ORDER BY IF(files.galeria>0,1,0) DESC, referencia_eng.nev [connect] => Resource id #5 [query] => Array ( [dir] => profile [lang] => eng [page] => 18 [id] => 0 [ref] => gap-plot-utilization-by-constructing-an-apartment-house-erkel-str-14-a/ [p] => 0 ) [file] => [errorlog] => Array ( [0] => Array ( [file] => /home/adminis3/public_html/vardom/system/mysql.php [line] => 37 [function] => error_report [args] => Array ( [0] => SELECT DISTINCT referencia.id AS id, referencia_eng.nev AS nev, referencia_eng.dirgen AS dirgen, referencia.priority AS priority, terulet_eng.nev AS terulet, files.galeria AS galeria, files.id AS file FROM _referencia LEFT JOIN referencia_eng ON referencia_eng.id = _referencia.referencia LEFT JOIN referencia ON referencia.id = _referencia.referencia LEFT JOIN terulet_referencia ON terulet_referencia.referencia = referencia.id LEFT JOIN terulet_eng ON terulet_eng.id = terulet_referencia.terulet LEFT JOIN files ON files.galeria = referencia.galeria AND files.ae = '1' AND files.filetipus = '1' WHERE _referencia. = '' AND referencia.aktiv = '1' AND referencia_eng.active = '1' ORDER BY IF(files.galeria>0,1,0) DESC, referencia_eng.nev [1] => Resource id #5 ) ) [1] => Array ( [file] => /home/adminis3/public_html/vardom/includes/catalog.php [line] => 152 [function] => sql_query [args] => Array ( [0] => SELECT DISTINCT referencia.id AS id, referencia_eng.nev AS nev, referencia_eng.dirgen AS dirgen, referencia.priority AS priority, terulet_eng.nev AS terulet, files.galeria AS galeria, files.id AS file FROM _referencia LEFT JOIN referencia_eng ON referencia_eng.id = _referencia.referencia LEFT JOIN referencia ON referencia.id = _referencia.referencia LEFT JOIN terulet_referencia ON terulet_referencia.referencia = referencia.id LEFT JOIN terulet_eng ON terulet_eng.id = terulet_referencia.terulet LEFT JOIN files ON files.galeria = referencia.galeria AND files.ae = '1' AND files.filetipus = '1' WHERE _referencia. = '' AND referencia.aktiv = '1' AND referencia_eng.active = '1' ORDER BY IF(files.galeria>0,1,0) DESC, referencia_eng.nev [1] => Resource id #5 ) ) [2] => Array ( [file] => /home/adminis3/public_html/vardom/includes/kereso.php [line] => 129 [args] => Array ( [0] => /home/adminis3/public_html/vardom/includes/catalog.php ) [function] => include ) [3] => Array ( [file] => /home/adminis3/public_html/vardom/includes/main.php [line] => 144 [args] => Array ( [0] => /home/adminis3/public_html/vardom/includes/kereso.php ) [function] => include ) [4] => Array ( [file] => /home/adminis3/public_html/vardom/index.php [line] => 115 [args] => Array ( [0] => /home/adminis3/public_html/vardom/includes/main.php ) [function] => include ) ) [key] => p [key2] => function [key3] => 0 )