I almost have the data I want…but need help filtering it. (pic at bottom)
The query below returns all records with a status of Member-id5 but I need to filter that. Ex: If I did a simple query on ect. (exp_channel_titles) for author_id 323 I would get 5 results. Of those 5 results one row has status = 'Member-id5', another one has a status = 'complete' AND title = %Member% (that’s the deciding factor, the row with complete and Member in it). If that row exist then its okay to grab the entry_id of row status = Member-id5 to use for looking up the data in ecd (exp_channel_data) with in it. Any idea on how i can do that? picture enclosed
SELECT
ect.entry_id
, ect.author_id
, ect.title
, ect.status
, ecd.field_id_13
, ecd.field_id_14
, ecd.field_id_15
, ecd.field_id_25
, ecd.field_id_27
, ecd.field_id_28
, ecd.field_id_29
, ecd.field_id_30
, ecd.field_id_31
, ecd.field_id_32
, ecd.field_id_33
, ecd.field_id_34
, ecd.field_id_35
, exm.email
FROM exp_channel_titles as ect
LEFT JOIN exp_channel_data as ecd
ON ecd.entry_id = ect.entry_id
LEFT JOIN exp_members as exm
ON exm.member_id = ect.author_id
WHERE ect.status = 'Members-id5'

The picture is just of a simple query done on exp_channel_titles, of 323 as author_id. its to show how there multiple results and what entry_id i’m trying to get in order to finish my query. entry_id 496 is what I want, and that based on 1. there is a row with %Member% and complete in it. And then row 496 has a status of Members-id5.
1 Answer