I am trying to figure out how to write an instant messenger like Google talk/Facebook Chat for my website. The accounts would all be in a mysql database.
How could I get started with this?
Questions on Webmasters Stack Exchange are expected to relate to webmastering within the scope defined in the FAQ. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about closed questions here.
Might not be worth writing from scratch. If you look at services such as olark they offer live support chat for probably less per month than the cost of writing your own support chat.
If you are looking to have group chat, then look at cometchat. Its a script you can install on your server that will give you facebook style user to user chat.
If you want to write your own from scratch, you are going to have to deal with Ajax Polling, Comet, HTML5 websockets. Its a lot of work to support all browsers. Another option is to use pubnub and build on their infrastructure.
They implement the web sockets thing automatically, and you can focus your app specific requirements.