I want to do a Database request each 5 secounds. And if there is a new DB insert, I want to reload a Div!
My brain is burning I can't doing this without a tipp. Please help me
How about this...
Have a table that contains the "last update" date and nothing else. Then you can perform a very small query to see if that date has changed and then reload the page.
So when you insert (or update if you are worried about those too) you update the date in the last update table.
Your jQuery call should be a get request to a page that just outputs the date.
You compare the date with the one you obtained originally and if it has changed, reload.
$.get("http://yoursite/lastupdate.php", function (data) {
if (data != originalDate) {
document.location.reload();
}
});