Its best to learn these 3 things to achieve what you want.
Mysql ( to store the chat )
PHP ( to do teh actual script, to retrieve the chat for each user )
Ajax ( the javascript to run the php code without needing to refresh the webpage )
heres a simple php chat script i made a while back using a mysql backend.
Chck out w3c schools or tizag ( google them )
Its best to learn these 3 things to achieve what you want.
Mysql ( to store the chat )
PHP ( to do teh actual script, to retrieve the chat for each user )
Ajax ( the javascript to run the php code without needing to refresh the webpage )
heres a simple php chat script i made a while back using a mysql backend.
http://212.125.94.168/phpbb/viewtopic.php?t=53
x7chat is good. It is free and uses php/mysql
http://www.x7chat.com/