I suspect the following:
event_registration.eventname = $event
it should be
event_registrations.eventname = $event
After all, you used the plural form in both the from clause and the other part of the where clause.
Also note that only one of your parameters is quoted - it is not clear to me how you provide the parameters, but, of course, you must be consistent.
source share