Custom Query returning error when executed in Query Builder UI

Seems your are running php so this topic doesn’t apply to you, will continue on: