php ajax 12:59 sohbet sorun

1 Cevap php

i am trying to make php ajax one to one chat.............my problem is that how can i fetch the chat messages from table by both user1 and user2........ my database table has........

id, için, metin, zaman alanları, gelen ..............

ne kendi isimleri ile hem kullanıcıların iletilerini göstermek için sorgu olurdu ....

1 Cevap

En okunabilir olacaktır, ben form, inanıyorum:

SELECT <fields> FROM <table>
WHERE (from = :me AND to = :him OR from = :him AND to = :me)
  AND <more conditions>