Support

Home Forums Event Espresso Premium SQL Query with EVENTS_MEMBER_REL_TABLE?

SQL Query with EVENTS_MEMBER_REL_TABLE?

Posted: August 28, 2015 at 3:29 pm

Viewing 6 reply threads


B D

August 28, 2015 at 3:29 pm

Hi,

I found this code: https://gist.github.com/Apina/f11b5ce2db10f7b3bb93 and worked off it to build a query but I get an error. Is this for an old version of EE or am I missing a reference?

WordPress database error: [Table ‘mydb.EVENTS_MEMBER_REL_TABLE’ doesn’t exist]

If it’s for an old version of EE, would anyone know how to build a similar query in the new EE version?

Thank you.


B D

August 31, 2015 at 8:43 am

*bump*


Lorenzo Orlando Caum

  • Support Staff

August 31, 2015 at 11:17 am

Hi, the gist that you linked to was written for Event Espresso 3. Note that custom coding is not part of regular support but we try to provide starting points as time permits.


Lorenzo


B D

August 31, 2015 at 12:39 pm

Thanks Lorenzo. I found out that EE4 uses Model Querying now (http://developer.eventespresso.com/docs/model-querying/#Model_fields) and then found this article: http://developer.eventespresso.com/docs/model-querying/#Model_fields

But that code doesn’t seem to be working for me either! Has there been more updates that could have broke that as well?

Ultimately, I just want to check if a user has paid and registered for courses in a specific category and before a specific date range…


B D

August 31, 2015 at 12:46 pm

I realized I didn’t post any details about the issue I’m having with the code.

I’m getting an error for
Warning: Invalid argument supplied for foreach()


B D

August 31, 2015 at 12:55 pm

Some more info:
If I add back the if statement then it says “No booking found” but there are bookings for the user (I’ve tried multiple users).


B D

August 31, 2015 at 3:11 pm

Figured it out! Needed to add wp prefix:

$att_id = get_user_meta( $user_id, $wpdb->prefix . ‘EE_Attendee_ID’, true );

Viewing 6 reply threads

The support post ‘SQL Query with EVENTS_MEMBER_REL_TABLE?’ 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