title: How to change in where condition to read the number from some other db table?
body: <p>I like to change the number 2 with <code>id</code> from <code>users_tb</code>. How can I add that, <code>users_tb</code> is not in relationship with other tables it is only one column ID that is updated every time on some activity</p>
  
  <pre><code>SELECT messages.message,messages.sent_date, receiver_user.username, sender_user.username  FROM messages
          INNER JOIN users AS sender_user ON messages.msg_fk_user_id = sender_user.id
          INNER JOIN users AS receiver_user ON messages.receiver_id = receiver_user.id
          WHERE msg_fk_user_id = 1 AND receiver_id = 2 OR msg_fk_user_id = 2 AND receiver_id = 1
          ORDER BY `sent_date`;
  </code></pre>