Link to home
Start Free TrialLog in
Avatar of fastfind1
fastfind1

asked on

Continuously Update mysql query

I have a PHP scrpt that queries a database, and returns the number of records in the query.  The query works.  However, I need to have this number of records updated continuously.  So as other users add records, this counter increases WITHOUT reloading the page.  Any ideas?

I am thinking of something similar to ecommerce sites that as you put a new item in your cart, the counter showing the number of items in the cart increases, even though the page doesn't refresh.

Something similar to what Expert Exchange has for Open Questions and Question History.  The number of open questions is in () next to the Open Question Link.  I want something like that that updates dynamically without refreshing the whole web page.
$query_rs_select = "SELECT * FROM cbacks WHERE assessor_done = 0  AND mid_user = '$user' ";
$rs_select = mysql_query($query_rs_select, $connect_crm) or die(mysql_error());
$row_rs_select = mysql_fetch_assoc($rs_select);
$totalRows_rs_select = mysql_num_rows($rs_select);
 if(!mysql_num_rows($rs_select)) {
 
$upload = 0;
 
} else {
$upload = $totalRows_rs_select;
  
 
}
echo $upload;

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of hielo
hielo
Flag of Wallis and Futuna image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial