如何检查是否已在mysql表中插入新数据

does anybody have any idea how the Facebook notification works?

I have this code

(function retrieve_req() {
    $.ajax({
        url: 'request_viewer_and_its_utilities.php',
        success: function(data) {
            $('.internal_load_request_from_extern_page').html(data);
        },
        complete: function() {
            // Schedule the next request when the current one's complete
            setTimeout(retrieve_req, 500);
        }
    });
})();

the problem is that I want to send only one data and if it is found only the append the data any idea how to do that?

Easy :

In the result of request_viewer_and_its_utilities.php, you return the code, is 0 is OK, is not 0 is not OK, in the logic in request_viewer_and_its_utilities.php, use try , catch to control some exception to insert data.