I need to query a database every .5 seconds, to see if a certain field is null or not. I already have this working in Java, but as PHP does not have threads I'm not too sure how to go about it. I've seen a lot of things about AJAX but I'm finding it very hard to apply it to my situation since I've never used AJAX before.
Basically I have a 'waiting' page. It will display an image and some text that says 'Waiting for Opponent'. In the background it will need to call my checkForOpponent() function, which returns either true or false.
If checkForOpponent == true, the person will be redirected to another page. If it's false, it will continue calling the method every .5 seconds.