Current location: Hot Scripts Forums » Programming Languages » PHP » update every 10 seconds


update every 10 seconds

Reply
  #1 (permalink)  
Old 09-20-11, 06:56 PM
phphelpme phphelpme is offline
Newbie Coder
 
Join Date: Jul 2010
Posts: 85
Thanks: 10
Thanked 0 Times in 0 Posts
update every 10 seconds

ok well i have this script right here that tells how many members are in the database
PHP Code:


//This is on the home page displaying every member in the database , i want it to update every 10 sec
$sql mysql_query("SELECT id FROM myMembers WHERE email_activated='1' ORDER BY id ASC"); 
$nr mysql_num_rows($sql); 
now how would i make ajax update this without having to refresh the page?
Reply With Quote
  #2 (permalink)  
Old 09-21-11, 04:01 AM
AlexPT AlexPT is offline
New Member
 
Join Date: Sep 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
<html>
<head>
<script src="./js/jquery-latest.js"></script>
<script>
var refreshId = setInterval(function()
{
$('#div').fadeOut("slow").load('response.php').fad eIn("slow");
}, 10000); //10 seconds
</script>
</head>
<body>

<div id="div"></div>
</body>
Reply With Quote
  #3 (permalink)  
Old 09-22-11, 05:38 PM
phphelpme phphelpme is offline
Newbie Coder
 
Join Date: Jul 2010
Posts: 85
Thanks: 10
Thanked 0 Times in 0 Posts
where is js/jquery-latest.js at?
Reply With Quote
  #4 (permalink)  
Old 09-27-11, 01:58 AM
xtron xtron is offline
Newbie Coder
 
Join Date: Apr 2011
Posts: 10
Thanks: 0
Thanked 1 Time in 1 Post
jQuery is a javascript framework / library. You can download it from their website...
Reply With Quote
Reply

Bookmarks

Tags
ajax, php, php and ajax, php and mysql


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
We're the Hot Scripts Forums SoftWareRevue Announcements 29 05-18-09 06:36 PM
IE6 Bug? My center column drops to footer position goatchaps CSS 5 08-31-07 12:15 PM
Update multiple rows outside loop - need help ElvansX PHP 1 12-03-06 01:55 AM
Update Scoreboard - ASP cancer10 ASP 0 10-24-06 06:46 AM
spend 10 seconds testing my site samsonh HTML/XHTML/XML 4 11-07-04 10:37 AM


All times are GMT -5. The time now is 08:51 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.