PDA

View Full Version : Auto reload



LegendOfNoob
03-05-2008, 04:06 PM
I am looking for a script to where when a mysql is updated it updates
ill be using php to output the mysql id like to use it to where when a form is submitted it popups a javascript type window with the message

like:
http://www.dynamicdrive.com/dynamicindex17/stickynote.htm


any ideas?

i believe i can insert mysql into that script

anyways +rep for help

Jackboy
03-05-2008, 10:21 PM
I don't understand what you need?

Possibly AJAX?

MicroZune
03-05-2008, 11:16 PM
k i have a form a staff inputs for a alert
and when mysql is updated it pops up the current message in the sticky popup

Verrou
04-05-2008, 04:30 AM
Speak english and maybe we can help you, what the hell does this mean:

I am looking for a script to where when a mysql is updated it updates

MicroZune
04-05-2008, 04:07 PM
basically he means
where when means like if mysql is updated it updates the user by popping up the sticky note

Hypertext
04-05-2008, 04:09 PM
Not english either.
If it's a javascript alert, simplest would be to make a 1 x 1 iframe, and put it at the bottom search for a file that checks the mysql and has a conditional statement to make a javascript alert if it has been changed, then use <meta http-equiv="refresh" content="25;this.page.php" /> which will refresh the page every 25 seconds, for more accuracy use ajax or change the refresh time, if this isn't what you wanted - learn english.

Jackboy
04-05-2008, 04:28 PM
Have a file that is checked every 5 seconds by ajax?

MicroZune
04-05-2008, 05:16 PM
if correct english was a standard for any type of talking people with accents such as
Mexicans
British
French
accents would count as misproper english aswell
its about your standards of speech

please do consider your inmature responses from all points of view

On Subject:

Possibly
Have every 5 seconds the first one is written to old and if old is matched to current it doesnt do it
then when theres a new one it writes the current to old and sets new and if they dont match it alerts users

MicroZune
04-05-2008, 06:11 PM
i am sorry to double post but i was browsing and saw this for everyone to better understand

ajax cannot as noted here because the connection is closed after its script is ran

http://www.daniweb.com/forums/thread101487.html

Dentafrice
04-05-2008, 06:18 PM
Like this.



<?php
if($action == "bla") {
$bla = $_POST["bla"];
mysql_query("UPDATE bla SET bla='$bla'") or die(mysql_error());
echo "<script type=\"text/javascript\">alert('stuff');</script>";
}
?>

Hypertext
05-05-2008, 03:01 AM
Going on from Dentafrice, if you'd like this all in php, this solution is bandwidth heavy but better overall:

<?php
while('1' = '1') {
$if_is = mysql_num_rows(mysql_query("SELECT bla FROM blabla WHERE blergh='bluh'") or die(mysql_error()));
if($if_is != '0') {
echo "<script type=\"text/javascript\">alert('stuff');</script>";
}
sleep(5)
}
// not tested this code
?>

Dentafrice
05-05-2008, 11:02 AM
How the hell would that be bandwith heavy :\

Excellent
05-05-2008, 11:07 AM
He doesn't know what he's talking about Mr.Dentafrice, he thinks a few lines of code is a couple thousand mb's of bandwidth.

Dentafrice
05-05-2008, 11:25 AM
LOL :P

The proper term is resource intensive, not bandwith heavy lmao. And the JS is CS so it doesn't matter.. its a simple query, which takes simple time, and a minimum amount of bandwith

Hypertext
05-05-2008, 12:41 PM
Ok, my bad, no need to go crazy, and stop with the 'mr's Gork!

Dentafrice
05-05-2008, 11:17 PM
No, it just pisses me off when in like 3-4 weeks you go from idiot to "Mr. Genius", which you constantly keep failing at.

Want to hide these adverts? Register an account for free!