You can use AJAX (Javascript) to periodically check the server for new messages. It cannot be done solely with PHP/MySQL.
pritaeas
Posting Expert
5,484 posts since Jul 2006
Reputation Points: 653
Solved Threads: 875
Javascript has a setTimeout() function that works like a timer. Every time it fires you can do something, whether the user is active or not.
pritaeas
Posting Expert
5,484 posts since Jul 2006
Reputation Points: 653
Solved Threads: 875