Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- id - message - sender - receiver
- 1 - hello - 1 - 2
- 2 - hello - 1 - 2
- 3 - hello - 2 - 1
- 4 - hello - 3 - 1
- 5 - hello - 1 - 3
- 6 - hello - 23 - 1
- 7 - hello - 1 - 23
- 8 - hello - 1 - 2
- id - name - email - phone
- 1 - abc1 - abc@gmail.com - 1234567890
- 2 - abc2 - abc@gmail.com - 1234567890
- 3 - abc3 - abc@gmail.com - 1234567890
- 23 - abc23 - abc@gmail.com - 1234567890
- SELECT * FROM messages INNER JOIN users ON messages.sender=users.id OR messages.receiver=users.id WHERE users.id!='1' GROUP BY users.id
Add Comment
Please, Sign In to add comment