Hey all, Hope you all have fun this saturday evening :) I'm sure i'm having fun except i'm kinda stuck... Ok here goes... I have 2 tables, one with the people online (chat_online): session_id activity And a second one where i keep the conversations between people(chat): user1_sessionid user2_sessionid chat_conv To see what chatter are still online during the last 2 minutes i do a check like this on the chat_online table: $limit_time= time()-130; $sqlchatonline="select * from chat_online where UNIX_TIMESTAMP(activity) >=$limit_time"; ok, on my page i also do a query to see what conversations are going on with the user: $thisuser=session_id(); $getchatlist="select * from chat where (user1_sessionid=$thisuser) or (user2_sessionid=$thisuser)"; This selects all the conversations which this user has been/or is into. I list all the chatpartners of thisuser. Off course it is possible that other chatters who had a conversation with this user are not online anymore. So i need to combine those two queries in a way... this is what i think it should be: $getchatlist=select * from chat where (user1_sessionid=$thisuser) or (user2_sessionid=$thisuser); $resultchatlist=mysql_query($getchatlist); while ($row=mysql_fetch_array($resultchatlist)) { get the second chattersessionid in each conversation and check if this chatter was still online in the last two minutes. if he is not, exclude him from the array and do not show him in the list (optional delete the record in the database) } or maybe i can combine those two queries in one? Can someone help me out on this? Thx in advance, Reinhart _____ Reinhart Viane <mailto:rv@xxxxxxxx> rv@xxxxxxxx Domos || D-Studio Graaf Van Egmontstraat 15/3 -- B 2800 Mechelen -- tel +32 15 44 89 01 -- fax +32 15 43 25 26 STRICTLY PERSONAL AND CONFIDENTIAL This message may contain confidential and proprietary material for the sole use of the intended recipient. Any review or distribution by others is strictly prohibited. If you are not the intended recipient please contact the sender and delete all copies.