MySQL error:

Query: SELECT l.linkToID, l.role, l.linkID FROM link l WHERE (l.linkWhatID = AND l.linkWhat = 'site' AND l.linkTo = 'event') UNION SELECT l.linkWhatID, l.role, l.linkID FROM link l WHERE (l.linkToID = AND l.linkTo = 'site' AND l.linkWhat = 'event')

at line 56 in file /var/sites/m/monasticwales.org/public_html/admin/db_config.inc.php

Error message: 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 l.linkWhat = 'site' AND l.linkTo = 'event') UNION SELECT l.linkWhatID, l.rol' at line 1