PHP Prob

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Athiththan
Forum Newbie
Posts: 1
Joined: Wed Jan 06, 2010 1:10 am

PHP Prob

Post 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...
Post Reply