Page 1 of 1

Checking when data changes in a database

Posted: Mon Aug 11, 2003 9:55 pm
by like_duh44
Hello, I have a chat that i'm making, going along very well. (http://www.aataclan.tk click on =AATA= webchat on the left) Anyway, I have the current version to get information from a database of the users online and posts available. What script would allow me to only have the page refresh (echo "<meta http-equiv=\"Refresh\" content=\"0\">"; ) when the data in the database changes? Thanks

Posted: Mon Aug 11, 2003 10:00 pm
by JAM
I hardly think you can without using some sort of cron-job directly on the server, not that it sounds like a good idea.

Whats wrong with letting the user sefl update the page when he/she needs, or by using a slight more modest meta-refresh of 5 or 10?

Posted: Mon Aug 11, 2003 10:02 pm
by like_duh44
Well, right now it refreshes the page every 5 seconds, which is really annoying because both frames click every refresh. Instead, there isnt any way to only have it refresh the page when the data changes?

Posted: Mon Aug 11, 2003 10:10 pm
by JAM
Well, if youre using frames, you should have >= two pages right. Why not just add the meta-refresh to that particular page that needs it?

Or am I totaly lost?

Posted: Mon Aug 11, 2003 10:17 pm
by like_duh44
you should check out the chat...but it still refreshes the frames with the users and posts, which is not only annoying, but if someone is reading the posts at the bottom, it refreshes and moves them up to the newest one. Its easier to understand if you check the site

Posted: Mon Aug 11, 2003 10:29 pm
by JAM
Cant you make a #name tag at the bottom of the chat-page (not visible to users) and in the meta-refresh call that whateverpage.php#hidden

That way when it updates its automaticly at the bottom of the page...

Posted: Mon Aug 11, 2003 10:30 pm
by like_duh44
lol, i mean, if people are reading older posts (at the bottom) every 5 seconds it refreshes and puts them to the top (new posts). There isnt any way to get it to only refresh when the database data changes?

Posted: Mon Aug 11, 2003 10:35 pm
by JAM
A foo, was reading it backwards, not new posts at top...
No, I'm out of clues.

Posted: Mon Aug 11, 2003 10:44 pm
by like_duh44
well, an idea, but no clue how to work it, would be to have a while of some sort