Support

Home Forums Translations Find user id from events_attendee in db

Find user id from events_attendee in db

Posted: October 24, 2013 at 12:28 pm


Noah Purves-Smith

October 24, 2013 at 12:28 pm

I’m trying to find the user id that registered for an event in the database. I’m looking through events_attendee, but I can’t see user id. I looked up ameta_id in events_attendee_meta, but that was a dead end. Any help would be appreciated.


Josh

  • Support Staff

October 24, 2013 at 3:06 pm

Hi Noah,

The user_id relationship is stored in the wp_events_member_rel table.


Noah Purves-Smith

October 24, 2013 at 3:47 pm

Hi Josh:

Thanks for your response. I did notice this table however I don’t see how it relates to the records in events_attendee. I notice that I can find the attendee_id in events_attendee_meta, but again, I don’t see how that relates to events_attendee either.


Josh

  • Support Staff

October 24, 2013 at 4:06 pm

Are you looking for user_id or are you looking for something else?


Noah Purves-Smith

October 24, 2013 at 4:38 pm

Hi Josh:

I’m trying to find out which users registered for which events. We’re having troubles adding users to specific groups for specific events, and we’re just doing some troubleshooting. We have to add users to a specific group only after their status is ‘Complete’; so events_member_rel wouldn’t work since it doesn’t have the payment_status. Users can type in whatever name and email address they want, so it isn’t as easy as looking those up in wp_users.


Josh

  • Support Staff

October 25, 2013 at 8:38 am

It sounds like your not actually looking for a user_id field then. Can you let us know the actual data column that you’re looking for, or a description or an example?

Thanks!


Noah Purves-Smith

October 25, 2013 at 9:29 am

Hi Josh:

I’m a bit confused. I just want to know which user is responsible for registering for which course. I don’t see a user id column in events_attendee, and the fname, lname, and email are user submitted (not generated by the account they’ve signed in with); therefore, I do not know how I can figure out which user signed up for which event. We specifically need the user id, because we’re trying to add each attendee to a group with the plugin Groups, by ithinx.com. For the most part, it was easy enough to put the group id as a meta tag in each event, and I wrote up a script in the payment_overview template to add the current_user_id to the group id in event_meta. However, sometimes (and we don’t know why yet), the users are not added to the group (our best guess is that our database is having troubles with simultaneous insert statements). So, at this point, we’re trying to find out which users need to be in which groups; but, looking at the events_attendee table hasn’t been of much help. Currently, we have 1951 records in wp_users, and 2229 records in events_attendee. We’d like to know how we can figure out which user registered for which event; or, if it’s even possible to find out that information. As I said before, the events_member_rel table would be great if it included payment_status, as we can’t tell which have been paid for (i.e. which users have actually paid to be in which group). So, is there a way for us to easily find out which users registered and paid for which events?


Josh

  • Support Staff

October 25, 2013 at 11:04 am

There is no need for the events_member_rel table to have payment status. That’s already in events_attendee. You can find the user_id from the events_member_rel and get the corresponding event_id and attendee_id there.

If you have id from the _events_attendee table for the entry you’re looking to match you look in _events_member_rel and the id from _events_attendee table will correspond to the attendee_id column. The user_id column will tell you the user_id for the person who made that registration.

screenshot of an entry of the _events_member_rel table

So in the above example the entry in the _events_attendee table that has an id of 312 was registered by the user account that has user_id 287.


Noah Purves-Smith

October 25, 2013 at 11:34 am

Hi Josh:

That’s exactly what I was looking for. Thank you!

The support post ‘Find user id from events_attendee in db’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso