$alici_id = '1';
$gonderen_id = '120';
$chatquery = mysql_query("
SELECT * FROM om
JOIN uyeler
ON uyeler.uye_id=om.om_alici_id OR uyeler.uye_id=om.om_gonderen_id
WHERE om.om_gonderen_id =".$gonderen_id." OR om.om_alici_id =".$alici_id." OR om.om_alici_id =".$gonderen_id." OR om.om_gonderen_id =".$alici_id."
GROUP BY om.om_tarih ");
while($chat = mysql_fetch_array($chatquery)) {
?>
Tablolar şöyle;
++++++++++++++++++++++++++++++++++++++++++++++