I am doing random chat like http://www.omegle.com/ for fun. Here how it goes:
Person logins, his id is inserted in seaching_chat table. He presses "Search" button and if there any other people in searching_chat, we connect them and delete information from seaching_chat table. If there are no people in the table, we use javascript and every 10 seconds check the mysql database to find out if somebody loged in.
So, is it the most efficient way to do such a thing? Any advices, ideas?