Page 1 of 1

PHP Prob

Posted: Wed Jan 06, 2010 4:15 am
by Athiththan
Hello,
I am new to PHP and Ajax...I have created a report in Ajax...

The query is
select p.POName,b.PostOffice,SUM(b.Amnt)Amount from poffice p,tblebillpayments b where p.POCode=b.PostOffice and p.Region='Galle' group by b.PostOffice

The code to display the result is
$qry_result = mysql_query($query) or die(mysql_error());
$qry_data=mysql_fetch_array($qry_result);

$display_string = "<center><table border=0.5 BORDERCOLOR=RED bgcolor=#FFFFCC>";
$display_string .= "<tr bgcolor=#CCCCFF>";
$display_string .= "<th>PO Name</th>";
$display_string .= "<th>Amount</th>";
$display_string .= "</tr>";

while($row = mysql_fetch_array($qry_result)){
$display_string .= "<tr>";
$display_string .= "<td ><b>$row[POName]</b></td>";
$display_string .= "<td>$row[Amount]</td>";
$display_string .= "</tr>";
}
$display_string .= "</table>";
echo $display_string;

When I tried to display the query result in my mysql server(PHP Myadmin) the query result is executing correctly but in the ajax page the result comes without the 0th(which is the first element) element in the array...

Pleae help me...