This is a chat application I have created on 24/04/2013 it still needs updates, and work done to it as it only works with 2 users.
DB setup:
Created a db called chatapp with 2 tables chat users
chat contains message_id , user_id , message , timestamp (message is text all the others are int)
users contains user_id , username (user_id is int and username is varchar)