Question : PHP Query for asterisk phone system - How to display live data from this query

Hello All,

I have recently written a PHP script for asterisk to check call center agents status while logged in. I am looking for the ability to display this script in real time for my users, I have read some previous examples in jquery but could not quite wrap my heads around it.

I am a total n00b in jquery and any assistance in the code would be greatly appreciated.

Thanks!
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
<?php

mysql_connect("localhost", "xxx", "xxx") or die(mysql_error());
mysql_select_db("asterisk_realtime") or die(mysql_error());
	
	//Selects agents ready and talking - filters logged out and not ready
	$query = "SELECT agents.name,agents.agent_code,agent_sessions.status FROM agents,agent_sessions 
				WHERE agents.agentid = agent_sessions.agentid AND (agent_sessions.status='ready' OR agent_sessions.status='talking') 
				ORDER BY agents.name";
	
   
	$result = mysql_query($query);
	
	//if (!$result)	{
	//	$message = 'Invalid Query: ' . mysql_error() . "\n";
	//	$message .= 'Whole query: ' . $query;
	//	die($message);
	//}
	
	echo "<table border='5'>";
	echo "<tr> <th>Name</th> <th>Calling Code</th> <th>Status</th> </tr>";
	while ($row = mysql_fetch_assoc($result)) {
	// Print out the contents of each row into a table
	echo "<tr><td>"; 
	echo $row['name'];
	echo "</td><td>"; 
	echo $row['agent_code'];
	echo "</td><td>"; 
	echo $row['status'];
	echo "</td></tr>"; 
	}
mysql_free_result($result);
$foo = $_POST['foo']; 
?>

Answer : PHP Query for asterisk phone system - How to display live data from this query

what about the identifier selected from the form, still part of the where clause?

strsql_tbl_old1 = "INSERT INTO tbl_old_issues (identifier,[datefieldName]) " _
                         & "SELECT identifier," & Now() & " FROM T6 Where T6.identifier =table2.identifier And T6.identifier = '" & Forms!frmt6.tvw1.SelectedItem & "'"
Random Solutions  
 
programming4us programming4us