I am making a php chat and am starting the php checking database part. So when a user types something into the chat, it gets recorded in the MySQL database, how would I chec
AJAX is probably the simplest solution. You can perform an AJAX request on the same page your PHP code is executing on if you really want to.
(function check() { $.get('mypage.php', function(data) { doSomethingWith(data); setTimeout(check, 5000); // every 5 seconds }); })();