php - Chat Application Database Query and Design -


this database scheme query below.

this scenario confuses me. when login user_id = 1 , create conversation , receiver user_id = 4 query below works.. because query retrieve conversations based on sender. when log in user_id = 4 can't see conversation because i'm receiver , don't want create conversation i'm sender , receiver user_id = 1 because conversation started user_id = 1. can me query?

change inner join include receiver well, so

inner join conversations on (userprofiles.user_id = userprofiles.receiver_id or userprofiles.user_id = sender_id) 

Comments

Popular posts from this blog

c - How to retrieve a variable from the Apache configuration inside the module? -

c# - Constructor arguments cannot be passed for interface mocks -

python - malformed header from script index.py Bad header -