Hi,
Here is my mysql query. It works.
SELECT dstchannel,sum(duration) from cdr where calldate like '2009-03-03%' group by substring(dstchannel,3,6)
How can I display the result on my web page. I am trying the following but it not working and I don't know how to fix it.
<?php
$connect = mysql_pconnect("localhost","user","pass") or Die("connect failed");
$selectdb = mysql_select_db("dbase") or Die("select failed");
$query = "SELECT dstchannel,sum(duration) from cdr where calldate like '2009-03-03%' group by substring(dstchannel,3,6)";
$connect;
$selectdb;
mysql_query($query) or die ("query x failed");
$res = mysql_query($query,$connect) or die("failed");
while($qry = mysql_fetch_array($res)) {
$dstchannel=$qry["dstchannel"];
print "$dstchannel";
print "<br>";
print "$duration";
print "<br>";
};
?>