Request under certain conditions

There is a mysql query

     SELECT datacenter.id, avatar, text, id_finish, datacenter.name, datacenter.surname  
   FROM massage JOIN datacenter 
   ON datacenter.id = massage.id_start 
  WHERE massage.id_finish = '$id'

How to make sure that the data from the text field is not taken when

  WHERE massage.id_finish = '$id'

and when

   WHERE massage.id_start = '$id'

Answer 1, authority 100%

SELECT datacenter.id, avatar, dc.text, id_finish, datacenter.name, datacenter.surname  FROM massage 
JOIN datacenter as dc ON datacenter.id = massage.id_start 
WHERE massage.id_finish = '$id'

You almost spelled it right 🙂