Re: can anyone help with this code?
Hi,
This is my first time with BP, just started off.. so pardon me in case I don’t understand your query correctly.
I suppose, since you are using the field user_login as your where clause, you can either use signups or users table to get the user_email field. However, only users has the field ID, signups doesn’t, so aren’t you better off using users ?
I guess since you want to tie up wpmu/bp to your plugin, so this might work:
SELECT distinct(u.ID), u.user_email FROM {$wpdb->users} u
LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id
WHERE u.user_login='{$username}’
Thanks,
Sib