Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- t.created_at,
- from_user.email_address as purchaser_email_address,
- t.purchaser_id as purchaser_user_id,
- to_user.email_address as to_email_address,
- user_photo.filename as photo_url
- FROM item_transactions t
- INNER JOIN `items` as i on t.item_id = i.id
- INNER JOIN `users` AS from_user ON t.purchaser_id = from_user.id
- INNER JOIN `users` as to_user ON t.user_id = to_user.id
- INNER JOIN `profiles` as to_user_profile ON t.user_id = to_user_profile.user_id
- INNER JOIN `photos` as user_photo ON to_user_profile.default_photo_id = user_photo.id
- WHERE t.result = 1 AND (t.user_id = 1 OR t.purchaser_id = 1);
Add Comment
Please, Sign In to add comment