HI
i want to dispaly the query result as attached file, i spent about 5 hours for it but fails.
i get the following format ( also in attached file ) can any body help me to sort this out the code i used as following:
the code i have used as:
<table cellpadding="0" cellspacing="1" style="font: normal 11px Verdana, Arial;" bgcolor="#FFFFFF" align="center">
<?php
$outPut = ""; $ii = 0;
$idForm = 26;
$idUser = 19;
$connect = dbConnect();
$sql_dated = dbQuery("select distinct(usrRatingAdded) from pg3_users_forms where frmID = '$idForm' and usrID = '$idUser' and usrRatingAdded >= '2008-05-20' and usrRatingAdded <= '2008-05-30' order by usrRatingAdded asc ", $connect);
while($res_dated = dbFetchArray($sql_dated) )
{
$first = $ff = true;
$dated = @dated( $res_dated['usrRatingAdded'], '-', ' ' );
$outPut .= "<tr bgcolor=\"#CCCCCC\"><td colspan=\"10\" style=\"padding: 3px;text-align:center;\"><b>{$dated}</b></td></tr>";
$sql_client = dbQuery("select distinct(clientID), fldID, usrAchieved from pg3_users_forms where frmID = '$idForm' and usrID = '$idUser' and usrRatingAdded = '{$res_dated['usrRatingAdded']}' ", $connect);
while( $res_client = dbFetchArray($sql_client) )
{
$client = dbaseTitle( $res_client['clientID'] );
$fieldID = $res_client['fldID'];
if( $ff )
{
$ff = false;
$outPut .= "<tr bgcolor=\"#F7F7F7\" valign=\"top\"><td style=\"padding: 5px; border: 1px solid #AAAAAA;\"><b>Client Name</b></td>";
$sql_field = dbQuery("select fld_title from pg3_forms_fields where frmID = '$idForm' order by fldID asc", $connect);
while( $res_field = dbFetchArray($sql_field) )
$outPut .= "<td style=\"padding: 5px; border: 1px solid #AAAAAA;\"><b>{$res_field['fld_title']}</b></td>";
$outPut .= "</tr>";
}
$sql_report = dbQuery("select clientID, usrAchieved, usrComments from pg3_users_forms where clientID='{$res_client['clientID']}' and frmID='$idForm' and usrRatingAdded >= '2008-5-20' and usrRatingAdded <= '2008-5-30' ", $connect);
$numRows = dbNumRows($sql_report);
if( $first )
{
$first = false;
$outPut .= "<tr bgcolor=\"#F7F7F7\" valign=\"top\"><td style=\"padding: 5px; border: 1px solid #AAAAAA;\"><b>{$client}</b></td>";
while( $res_report = dbFetchArray($sql_report) )
$outPut .= "<td style=\"padding: 5px; border: 1px solid #AAAAAA;\"><b>{$res_report['usrAchieved']}</b></td>";
$outPut .= "</tr>";
}
}
}
echo $outPut;
?>
</table>